Log In  


Advent (of code) is here!

On 1st December every year since 2015 starts the best advent calendar: Advent of Code! It's a series of 50 small programming challenges that get progressively harder every day and can be solved in any programming language!

Quote from the creator, Eric Wastl:

Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other.

I can't find any mentions about AoC on BBS which is a true shame, because PICO-8 is perfect for solving and visualising AoC puzzles! (At least the first ones.) I wanted to share this awesome contest with you and in this post I will be including carts with my solutions for as long as I can keep up. GL;HF!

If you want to compete here's my private leaderboard code: 979701-cf5ded3a

My solutions:

Days 1-6 (need to paste inputs):


Cart #aoc_2020_olus2000-5 | 2020-12-13 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1


Left/Right to cycle between days.
Up/Down to toggle between part 1 and part 2.
Paste your input and press O to run, then press O again to go back to day selection.
!!!WARNING!!!
Make sure you have pasted the input from the correct day, or the cartridge will break.

Days 1-3 (with my inputs):


Cart #aoc_2020_olus2000-4 | 2020-12-03 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1


Left/Right to cycle between days.
Up/Down to toggle between part 1 and part 2.
Future solutions will be delayed in order not to spoil them.

1


Looking forward to AoC this year. I thought about using PICO-8 last year, but so many of the puzzles required number math far beyond the scope of what PICO-8 can deal with natively. I'm sure there are workarounds that can be done, though. I ended up using last year's AoC to get back in the saddle with Python.


Sounds fun, don't think I'll get around to it.


@MBoffin I stumbled into PICO-8 related problems on the first day already :P The answers don't fit in a PICO-8 number so I've had to leave them as multiplications. I'm looking forward to solving such problems in the future, but I'll surely switch to Python at some point. I'll try to delay this as much as possible though, no matter how many questionable workarounds it requires.


1

@olus2000 Yeah, it's tough. However, if you poke around the BBS, you'll find some interesting solutions for dealing with large numbers. I believe @Felice posted a quite elegant, token-light solution for dealing with large numbers. If I find it again, I'll link it here. Nice work on the last two days, though! :)


With a lot of delay caused by work and my attempts at creating a bigint "class" (metatable + constructor function) I'm trying to catch up with AoC. Day 4 input was so big it wouldn't fit on a .p8.png cart, so I switched the approach and now you have to (or are able to) paste your input to be used by the solution. New cart features big numbers and an extremely ugly plane. Enjoy!

P.S. @MBoffin I couldn't find anything, either from @Felice or not. I saw their profile though, and if they did something like that then I wish I could see it!


@olus2000 I poked around and I think this might be the thread I was originally thinking of? I'm not sure if it will actually help you, but maybe? https://www.lexaloffle.com/bbs/?tid=31269

Unfortunately, I found that today's puzzle actually needed 64-bit integers. 😬



[Please log in to post a comment]