Programming, Source: Advent of Code

All posts

Recent posts

AoC 2016 Day 4: Room Validator

Source: Security Through Obscurity1

Part 1: A room is described as a name, a sector ID, and a checksum as follows:

aaaaa-bbb-z-y-x-123[abxyz]

name: aaaaa-bbb-z-y-x
sector ID: 123
checksum: abxyz

A room is valid if the checksum contains the five most common letters if the name (ties broken alphabetically).

read more...


AoC 2016 Day 2: Pin Typer

Source: Bathroom Security

Part 1: Take a keypad with the following layout:

1 2 3
4 5 6
7 8 9

Using the instructions UDLR for Up, Down, Left, and Right respectively, move a ‘finger’ around over the keypad. At the end of each line of instructions, output the current digit.

read more...


Advent of Code: Day 24

Source

Part 1: Split a list of integers into three groups of equal sum. Find the grouping such that the smallest group has the least items, breaking ties by the smallest product for that group.

read more...


Advent of Code: Day 23

Source

Part 1: Create a simple virtual machine with two registers (a and b, non-negative integers) and six instructions:

  • hlf (a|b) - divide the given register by half, round down
  • tpl (a|b) - triple the given register
  • inc (a|b) - add 1 to the given register
  • jmp [+-]\d+ - jump forward/backwards by the given number of instructions
  • jie (a|b), [+-]\d+ - if the given register is even, jump
  • jio (a|b), [+-]\d+ - if the given register equals one, jump

read more...