Skip to content

lrc-se/aoc-2019

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code 2019

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.

Day 1

JavaScript (Node 11.6)

Quick-and-dirty dependency-less stuff, with equally quick-and-dirty tests (of sorts).

Day 2

Python (3.8)

Class-based public-member approach, with unit tests.

Day 3

PHP (7.3)

Using various built-in array functions.

Day 4

Pascal (Turbo Pascal 7)

A blast from the past! Written and compiled with TPX in dosbox.

Day 5

C# (.NET 4.7)

Back to the future. Mmm, types.

Day 6

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).

Day 7

VB (.NET 4.7)

Back in CLR land, now with multithreading.

Day 8

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.

Day 9

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.

Day 10

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.

Day 11

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.

Day 12

C# (.NET 4.7)

First full return show of the series. Still big on types, but with a string-based shortcut in part two.

Day 13

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.

Day 15

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 north
  • down: move south
  • left: move west
  • right: move east
  • m: export current map as JSON
  • l: load map from JSON file
  • space: start oxygen fill process
  • esc: reset to initial conditions

Finding the oxygen system and producing a complete map is left as an exercise to the reader.

Day 16 (part 1)

PHP (7.3)

Arrays again. Mmm, arrays.

Day 17

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).

Day 19

Java (JDK 13)

Straight copy of the intcode runner from the previous Java implementation (day 9). Quick math-based solutions, without bells or whistles.

Day 21 (part 1)

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.

Day 22 (part 1)

Python (3.8)

Sequence handling is easy in Python. At least when they're not ginormous...

Day 23

JavaScript (Node 11.6)

Using the previous intcode runner, sans ASCII extension but with more Node events.

Day 24

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.

Day 25

JavaScript (Node 11.6)

Using the previous ASCII intcode runner. Enter an empty command to quit the game.