Solutions for the 2019 edition of Advent of Code, with each day in a subfolder of its own. The plan is to use as many languages and platforms/environments as possible, not excluding obsolete ones. We'll see how it goes.
JavaScript (Node 11.6)
Quick-and-dirty dependency-less stuff, with equally quick-and-dirty tests (of sorts).
Python (3.8)
Class-based public-member approach, with unit tests.
PHP (7.3)
Using various built-in array functions.
Pascal (Turbo Pascal 7)
A blast from the past! Written and compiled with TPX in dosbox.
C# (.NET 4.7)
Back to the future. Mmm, types.
VBScript (Windows Scripting Host)
Without .NET framework dependencies. To run as classic ASP, use Server.MapPath
for file access and replace the MsgBox
calls with Response.Write
(and some line breaks).
VB (.NET 4.7)
Back in CLR land, now with multithreading.
Assembly (x86)
Another visit to the distant past, using DOS service calls. Numerical values are printed in big-endian hex format, and in the rendered image .
represents black and #
white.
Assembled with NASM to .COM binary targets and tested in dosbox.
Java (JDK 13)
The intcode runner is ported from the previous .NET version and so may not be entirely idiomatic. No project structure, just plain source files.
QuickBASIC (7.1)
Well, this took some doing (and thinking), but a mathematical approach simplified things. Some hoops had to be jumped through in order to support both CRLF and LF files, not to mention the need to implement quicksort from scratch for the second part. Whew! Written and run with QBX in dosbox.
JavaScript (browser/DOM)
Yet another port of the intcode runner, which is now wholly event-based. Vanilla ES5 all the way, with AJAX retrieval of input data.
C# (.NET 4.7)
First full return show of the series. Still big on types, but with a string-based shortcut in part two.
JavaScript (Vue 2.6)
Using the previous version of the intcode runner as-is, but with Vue handling the frontend this time. There's no build step so we're still not going beyond ES5, but with a Promise polyfill.
To play, use the arrow keys to advance one frame: left
to move left, right
to move right, and down
to remain in the same position.
In addition, enter
toggles auto mode and esc
resets the game. And yes, that's an actual paddle.
JavaScript (Vue 2.6)
Similar to day 13, but with an updated version of the ES5 intcode runner (and less polished visuals). The following key commands are available:
up
: move northdown
: move southleft
: move westright
: move eastm
: export current map as JSONl
: load map from JSON filespace
: start oxygen fill processesc
: reset to initial conditions
Finding the oxygen system and producing a complete map is left as an exercise to the reader.
PHP (7.3)
Arrays again. Mmm, arrays.
JavaScript (Node 11.6)
Using the ASCII intcode runner from day 21. Movement instructions for the second part were arrived at manually (which wasn't very difficult).
Java (JDK 13)
Straight copy of the intcode runner from the previous Java implementation (day 9). Quick math-based solutions, without bells or whistles.
JavaScript (Node 11.6)
Back in ES6+ territory with an updated version of the JS intcode runner (day 11+13), utilizing Node's event system.
Python (3.8)
Sequence handling is easy in Python. At least when they're not ginormous...
JavaScript (Node 11.6)
Using the previous intcode runner, sans ASCII extension but with more Node events.
C# (.NET 4.7)
Nothing of particular note in part one, but part two took some thinking to limit recursion levels and handle all tile updates in proper sequence.
JavaScript (Node 11.6)
Using the previous ASCII intcode runner. Enter an empty command to quit the game.