Documentation
¶
Overview ¶
Package aoc2016 implements the solutions for Advent of Code 2016.
Index ¶
- Variables
- func Day01(input string) (answer1, answer2 string, err error)
- func Day02(input string) (answer1, answer2 string, err error)
- func Day03(input string) (answer1, answer2 string, err error)
- func Day04(input string) (answer1, answer2 string, err error)
- func Day05(input string) (answer1, answer2 string, err error)
- func Day06(input string) (answer1, answer2 string, err error)
- func Day07(input string) (answer1, answer2 string, err error)
- func Day08(input string) (answer1, answer2 string, err error)
- func Day09(input string) (answer1, answer2 string, err error)
- func Day12(input string) (answer1, answer2 string, err error)
- func Unimplemented(scanner string) (string, string, error)
Constants ¶
This section is empty.
Variables ¶
var AllSolutions = []func(string) (string, string, error){ Day01, Day02, Day03, Day04, Day05, Day06, Day07, Day08, Day09, Unimplemented, Unimplemented, Day12, Unimplemented, Unimplemented, Unimplemented, Unimplemented, Unimplemented, Unimplemented, Unimplemented, Unimplemented, Unimplemented, Unimplemented, Unimplemented, Unimplemented, Unimplemented, }
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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
Types ¶
This section is empty.