aoc2016

package
v0.0.0-...-3a8fa55 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 26, 2023 License: MIT Imports: 12 Imported by: 0

README

= Advent of Code 2016

== Progress

* [*] Day 1: No Time for a Taxicab
* [*] Day 2: Bathroom Security
* [*] Day 3: Squares With Three Sides
* [*] Day 4: Security Through Obscurity
* [*] Day 5: How About a Nice Game of Chess?
* [*] Day 6: Signals and Noise
* [*] Day 7: Internet Protocol Version 7
* [*] Day 8: Two-Factor Authentication
* [ ] Day 9: Explosives in Cyberspace
* [ ] Day 10: Balance Bots
* [ ] Day 11: Radioisotope Thermoelectric Generators
* [*] Day 12: Leonardo's Monorail
* [ ] Day 13: A Maze of Twisty Little Cubicles
* [ ] Day 14: One-Time Pad
* [ ] Day 15: Timing is Everything
* [ ] Day 16: Dragon Checksum
* [ ] Day 17: Two Steps Forward
* [ ] Day 18: Like a Rogue
* [ ] Day 19: An Elephant Named Joseph
* [ ] Day 20: Firewall Rules
* [ ] Day 21: Scrambled Letters and Hash
* [ ] Day 22: Grid Computing
* [ ] Day 23: Safe Cracking
* [ ] Day 24: Air Duct Spelunking
* [ ] Day 25: Clock Signal

Documentation

Overview

Package aoc2016 implements the solutions for Advent of Code 2016.

Index

Constants

This section is empty.

Variables

AllSolutions is the slice of all solutions so that they may be indexed easily. Note that slice index starts at 0 and not 1 so AllSolutions[0] is the solution for Day 1.

Functions

func Day01

func Day01(input string) (answer1, answer2 string, err error)

Day01 solves the first day puzzle "No Time for a Taxicab".

Input

A single line containing 161 instructions separated by ", ", where each instruction describes a turn direction and the distance to travel. For example:

R5, L5, R5, R3

It is guaranteed that the distance to travel per instruction is no greater than 200. It is also guaranteed that each instruction is prefixed by either "R" or "L".

func Day02

func Day02(input string) (answer1, answer2 string, err error)

Day02 solves the second day puzzle "Bathroom Security".

Input

A file of some number of lines, each containing variable length and only the characters `U`, `D`, `L`, and `R`. For example:

ULL
RRDDD
LURDL
UUUUD

It is guaranteed that no line exceeds 600 characters, and there are no more than five lines.

func Day03

func Day03(input string) (answer1, answer2 string, err error)

Day03 solves the third day puzzle "Squares With Three Sides".

Input

A file containing several lines each containing three numbers that describe a triangle's sides. For example:

539  165  487
815  742   73
353  773  428
526  152  680
433  711  557
168  632  306

It is guaranteed that there are no more than 1600 lines and that no side is more than three digits long.

func Day04

func Day04(input string) (answer1, answer2 string, err error)

Day04 solves the fourth day puzzle "Security Through Obscurity".

Input

A file where each line represents a room, which is of the format ENCRYPTEDNAME-SECTORID[CHECKSUM], where ENCRYPTED NAME consists of lowercase letters separated by dashes, SECTORID is an integer between 100 and 999, and CHECKSUM is a string containing five lowercase letters. For example:

ipvohghykvbz-ihzrla-jbzavtly-zlycpjl-253[lzhvy]
cybyjqho-whqtu-rqiauj-fkhsxqiydw-322[syzwi]
tipfxvezt-sleep-tljkfdvi-jvimztv-425[tveif]
ktiaaqnqml-xtiabqk-oziaa-xczkpiaqvo-616[aiqko]
ckgvutofkj-xghhoz-gtgreyoy-306[nyhpz]

The input contains at most 1000 lines, and it is guaranteed that ENCRYPTEDNAME is at most of length 60.

func Day05

func Day05(input string) (answer1, answer2 string, err error)

Day05 solves the fifth day puzzle "How About a Nice Game of Chess?".

Input

A single line that represents the Door ID. For example:

ffykfhsq

It is guaranteed that the input contains at least one line.

func Day06

func Day06(input string) (answer1, answer2 string, err error)

Day06 solves the sixth day puzzle "Signals and Noise".

Input

A file containing some number of lines each having the same length as one another. For example:

jsgoijzv
iwgxjyxi
yzeeuwoi
gmgisfmd
vdtezvan
secfljup
dngzexve
xzanwmgd
ziobunnv

It is guaranteed that all lines have the same length and that there are no more than 600 lines.

func Day07

func Day07(input string) (answer1, answer2 string, err error)

Day07 solves the seventh day puzzle "Internet Protocol Version 7".

Input

A file containing at most 2000 lines, each line representing an IPv7 address containing the lowercase letters `a` to `z` and the bracket characters `[` and `]`, each line of length at most 150.

For example:

abba[mnop]qrst
ioxxoj[asdfgh]zxcvbn
wvwhsvattcfkxsjbif[bkesznrpxrlcnsmhbxv]rdycrgrtwazfqlx[genmoutcoedshrn]ucufntphttrvzmgt

func Day08

func Day08(input string) (answer1, answer2 string, err error)

Day08 solves the eight day puzzle "Two-Factor Authentication".

Input

A series of card instructions that look like the following:

rect AxB
rotate row y=A by B
rotate column x=A by B

An invalid instruction will cause an error.

func Day09

func Day09(input string) (answer1, answer2 string, err error)

Day09 solves the ninth day puzzle "Explosives in Cyberspace".

Input

A single line, containing a sequence of bytes representing the experimental format. It is assumed that the data is valid, and it does not contain more than 15,000 characters. For example:

(6x1)(1x3)A

func Day12

func Day12(input string) (answer1, answer2 string, err error)

Day12 solves the twelvth day puzzle "Leonardo's Monorail".

Input

A list of instructions written in assembunny. The number of instructions do not exceed 50. For example:

cpy 41 a
inc a
inc a
dec a
jnz a 2
dec a

func Unimplemented

func Unimplemented(scanner string) (string, string, error)

Unimplemented function returns an error simply stating unimplemented.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL