# AoC 2016 Day 16: Dragon Data

### Source: Dragon Checksum

Part 1: Generate noise using a modified dragon curve:

• Start with data a
• Create a copy of the data b, reverse and invert it (0 <-> 1)
• Create the string a0b

Repeat until you have enough data, truncate at the end if needed.

From this string calculate a checksum as follows:

• xor each pair of bits, concatenate the results
• If the resulting string has an even length, repeat; if it’s odd, stop

Calculate the checksum of a given initial state expanded to 272 bits.

# AoC 2016 Day 15: Capsule Dropper

### Source: Timing is Everything

Part 1: Given a series of openings one second apart, each with n positions that advance one position per second, what is the first time you can start the simulation so that you pass each in position 0.

Part 1: Calculate a series of MD5 hashes (the same as Day 5). A hash is considered valid if it contains a triple (three characters in a row) and somewhere in the next 1000 hashes there is a quintuple of that same character.

What index produces the 64th key?

# AoC 2016 Day 13: Noisy Puzzle

### Source: A Maze of Twisty Little Cubicles1

Part 1: Generate a procedurally generated maze using the following equation:

• x^2 + 3x + 2xy + y + y^2 + c

x and y are the coordinates of a point and c is a constant.

Count the number of bits for each point. Even is open spaces, odd is walls.

What is the shortest route from (0, 0) to (31, 39)?

# AoC 2016 Day 12: Assembunny

### Source: Leonardo’s Monorail

Part 1: Create a virtual machine that has four registers (a, b, c, and d) and can process the following instructions:

• cpy x y - copies x into y (x can be an integer or a register)
• inc x - increases register x by one
• dec x - decreases register x by one
• jnz x y - jumps over y instructions if x is not zero (x can be an integer or a register)

What is the final value in register a?

# AoC 2016 Day 11: Radiation Avoider

Part 1: Input will be a list of the following form:

• The first floor contains a hydrogen-compatible microchip and a lithium-compatible microchip.
• The second floor contains a hydrogen generator.
• The third floor contains a lithium generator.
• The fourth floor contains nothing relevant.

You have an elevator that can move exactly 1 or 2 items. You can only leave a microchip on a floor with a non-matching generator if a matching generator is also present.

Move all items to the top (4th) floor.

# AoC 2016 Day 10: Bot Simulator

### Source: Balance Bots

Part 1: Create a sorting machine using input of the following form:

• value X goes to bot A - an input to bot A
• bot A gives low to (bot|output) B and high to (bot|output) C - a sorter that takes two inputs and sends them to the specified bots or output channels

Find the bot that compares the values 17 and 61.

# AoC 2016 Day 9: Decompressinator

### Source: Explosives in Cyberspace

Part 1: A file is compressed by including compression markers of the form (#x#)... where the first number tells how many characters to copy and the second is how many times to copy them. So A(2x3)HA! becomes AHAHAHA!.

# AoC 2016 Day 8: Tiny Screen Simulator

### Source: Two-Factor Authentication

Part 1: Implement a 50x6 pixel screen with the following commands:

• rect AxB turn on a rectangle of pixels in the top left corner
• rotate row y=A by B rotates row A right by B pixels
• rotate column x=A by B rotates column A down by B pixels

After a given sequence of commands, how many pixels are on?