As I did last year, I’m going to solve the Advent of Code problems again this year.

Or that was the plan. It turns out that instead I put down my blog for almost a year and a half and never quite got around to doing these problems. So I’m actually backdating these posts from the early days of 2018 to where they would have been had I solved them on time. They’re still interesting problems, so give them a read.

# AoC 2016 Day 25: Assembunny3

### Source: Clock Signal

Part 1: Take the assembunny interpreter from day 12 and add one new instruction (out x) which transmits the value x (either an integer or register). Find the lowest value we can initialize a to so that the output signals form an infinite repeating pattern of 0, 1, 0, 1, …

# AoC 2016 Day 24: Venti

### Source: Air Duct Spelunking

Part 1: Given a map of the form:

########### #0.1…..2# #.#######.# #4…….3# ###########

# AoC 2016 Day 23: Assembunny2

### Source: Safe Cracking

Part 1: Take the assembunny interpreter from day 12 and add an instruction (tgl X) that modifies the code at an offset of X instructions.

• inc becomes dec; any other one argument instruction (including tgl) becomes inc
• jnz becomes cpy; any other two argument instructions become jnz
• Toggling an instruction outside of the program does nothing (it does not halt execution)
• If toggling produces an invalid instruction, ignore it

Run the given program with the initial register of a = 7. What is the final value in register a?

# AoC 2016 Day 22: Data Mover

### Source: Grid Computing

Part 1: You are given a grid of nodes and the output of the df command telling you how much space is on each. How many pairs of nodes are there where the data from some node A would fit entirely on B?

# AoC 2016 Day 21: Scrambler

### Source: Scrambled Letters and Hash

Part 1: Another virtual machine, of sorts. Start with the string abcdefgh and apply a sequence of the following commands to it:

• swap position X with position Y = swap two positions
• swap letter X with letter Y = swap to letters, no matter where they are
• rotate (left|right) X steps = rotate forward or backward
• rotate based on position of letter X = find X, rotate right based on its position; if the original position was >= 4, rotate one more1
• reverse positions X through Y = reverse a subset of the string
• move position X to position Y = take a character at a position out of the string and put it somewhere else specific

# AoC 2016 Day 20: Filter Table

### Source: Firewall Rules

Part 1: Given a list of integer ranges (a la 5-8), what is the first value not in any given range?

# AoC 2016 Day 19: Blist Table

### Source: An Elephant Named Joseph

Part 1: Create a circular list of the numbers 1 through n. Going around the list, each currently remaining number removes the number after it. What is the last remaining number?

# AoC 2016 Day 18: Its A Trap

### Source: Like a Rogue

Part 1: Starting with a sequence of . and ^, generate additional rows using the rules based on the three characters above the new position.

• ^^. -> ^
• .^^ -> ^
• ^.. -> ^
• ..^ -> ^
• Otherwise -> .

How many safe tiles (.) are there after 40 generations?

# AoC 2016 Day 17: Md5 Maze

### Source: Two Steps Forward

Part 1: Create a 4x4 grid of rooms with doors Up, Down, Left, and Right from each location. To determine if a door is currently open:

• Calculate MD5(salt + sequence) where sequence is a string containing any combination of UDLR depending on how you got to this room
• The first four hex values represent the doors Up, Down, Left, and Right respectively: bcdef means open; anything else is closed

Find the shortest path from (0, 0) to (3, 3).