diff --git a/2020/day01.go b/2020/day01.go index 239e828..a6d010f 100644 --- a/2020/day01.go +++ b/2020/day01.go @@ -4,12 +4,12 @@ import ( "fmt" "os" - "git.annabunch.es/annabunches/adventofcode/2020/lib/fileutils" + "git.annabunch.es/annabunches/adventofcode/2020/lib/util" ) func main() { step := os.Args[1] - values := fileutils.InputParserIntMap(os.Args[2]) + values := util.InputParserIntMap(os.Args[2]) switch step { case "1": diff --git a/2020/day02.go b/2020/day02.go index ce8a02d..8b8e2d2 100644 --- a/2020/day02.go +++ b/2020/day02.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "git.annabunch.es/annabunches/adventofcode/2020/lib/fileutils" + "git.annabunch.es/annabunches/adventofcode/2020/lib/util" ) func checkLine(line string, step string) int { @@ -50,7 +50,7 @@ func checkLine(line string, step string) int { func main() { step := os.Args[1] - values := fileutils.InputParserStrings(os.Args[2]) + values := util.InputParserStrings(os.Args[2]) total := 0 for _, line := range values { diff --git a/2020/day03.go b/2020/day03.go index b5c6f15..c8e1e02 100644 --- a/2020/day03.go +++ b/2020/day03.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "git.annabunch.es/annabunches/adventofcode/2020/lib/fileutils" + "git.annabunch.es/annabunches/adventofcode/2020/lib/util" ) func countTrees(input []string, right, down int) int { @@ -26,7 +26,7 @@ func countTrees(input []string, right, down int) int { func main() { step := os.Args[1] - values := fileutils.InputParserStrings(os.Args[2]) + values := util.InputParserStrings(os.Args[2]) switch step { case "1": diff --git a/2020/day04.go b/2020/day04.go index 41fa5b3..f462fe5 100644 --- a/2020/day04.go +++ b/2020/day04.go @@ -8,7 +8,6 @@ import ( "strconv" "strings" - "git.annabunch.es/annabunches/adventofcode/2020/lib/fileutils" "git.annabunch.es/annabunches/adventofcode/2020/lib/util" ) @@ -130,7 +129,7 @@ func makeInt(input string) int { func main() { step := os.Args[1] - values := fileutils.InputParserStrings(os.Args[2]) + values := util.InputParserStrings(os.Args[2]) values = util.SplitOnBlankLine(values) fmt.Println("Valid Passports:", countValidPassports(values, step)) diff --git a/2020/day05.go b/2020/day05.go index 2fa82ee..d45b649 100644 --- a/2020/day05.go +++ b/2020/day05.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "git.annabunch.es/annabunches/adventofcode/2020/lib/fileutils" + "git.annabunch.es/annabunches/adventofcode/2020/lib/util" ) func calculateSeatNumber(input string) int { @@ -28,7 +28,7 @@ func calculateSeatNumber(input string) int { func main() { step := os.Args[1] - values := fileutils.InputParserStrings(os.Args[2]) + values := util.InputParserStrings(os.Args[2]) switch step { case "1": diff --git a/2020/day06.go b/2020/day06.go index 00a6e2c..d81104d 100644 --- a/2020/day06.go +++ b/2020/day06.go @@ -5,7 +5,6 @@ import ( "os" "strings" - "git.annabunch.es/annabunches/adventofcode/2020/lib/fileutils" "git.annabunch.es/annabunches/adventofcode/2020/lib/util" ) @@ -45,7 +44,7 @@ func countAnswerIntersection(input string) int { func main() { step := os.Args[1] - values := fileutils.InputParserStrings(os.Args[2]) + values := util.InputParserStrings(os.Args[2]) groups := util.SplitOnBlankLine(values) total := 0 diff --git a/2020/day07.go b/2020/day07.go index d07702a..e0e51da 100644 --- a/2020/day07.go +++ b/2020/day07.go @@ -7,7 +7,7 @@ import ( "regexp" "strconv" - "git.annabunch.es/annabunches/adventofcode/2020/lib/fileutils" + "git.annabunch.es/annabunches/adventofcode/2020/lib/util" ) type Node struct { @@ -89,7 +89,7 @@ func countChildren(node *Node) int { func main() { step := os.Args[1] - values := fileutils.InputParserStrings(os.Args[2]) + values := util.InputParserStrings(os.Args[2]) nodeMap = make(map[string]*Node) diff --git a/2020/day08.go b/2020/day08.go index 58929bd..8c6e8a5 100644 --- a/2020/day08.go +++ b/2020/day08.go @@ -7,7 +7,7 @@ import ( "strconv" "strings" - "git.annabunch.es/annabunches/adventofcode/2020/lib/fileutils" + "git.annabunch.es/annabunches/adventofcode/2020/lib/util" ) type Instruction struct { @@ -59,7 +59,7 @@ func executeProgram(instructions []Instruction) (int, bool) { func main() { step := os.Args[1] - values := fileutils.InputParserStrings(os.Args[2]) + values := util.InputParserStrings(os.Args[2]) instructions := make([]Instruction, 0) diff --git a/2020/day09.go b/2020/day09.go index 7e0308b..248e5f4 100644 --- a/2020/day09.go +++ b/2020/day09.go @@ -5,7 +5,7 @@ import ( "log" "os" - "git.annabunch.es/annabunches/adventofcode/2020/lib/fileutils" + "git.annabunch.es/annabunches/adventofcode/2020/lib/util" ) type SumTracker map[int][]Tuple @@ -85,7 +85,7 @@ func sumMinMax(values []int) int { func main() { step := os.Args[1] - values := fileutils.InputParserInts(os.Args[2]) + values := util.InputParserInts(os.Args[2]) var badValue int sumMap := make(SumTracker) diff --git a/2020/day10.go b/2020/day10.go index 69934a1..553a3d5 100644 --- a/2020/day10.go +++ b/2020/day10.go @@ -5,7 +5,7 @@ import ( "log" "os" - "git.annabunch.es/annabunches/adventofcode/2020/lib/fileutils" + "git.annabunch.es/annabunches/adventofcode/2020/lib/util" ) func getMax(values map[int]bool) int { @@ -88,7 +88,7 @@ func countPaths(node *Node, target int) int { func main() { step := os.Args[1] - values := fileutils.InputParserIntMap(os.Args[2]) + values := util.InputParserIntMap(os.Args[2]) diffMap := make(map[int]int) diff --git a/2020/day11.go b/2020/day11.go index 92a587e..f138703 100644 --- a/2020/day11.go +++ b/2020/day11.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - "git.annabunch.es/annabunches/adventofcode/2020/lib/fileutils" + "git.annabunch.es/annabunches/adventofcode/2020/lib/util" ) func occupied1(board [][]byte, i, j int) int { @@ -95,7 +95,7 @@ func countOccupied(board [][]byte) int { func main() { step := os.Args[1] - board := fileutils.InputParserBytes(os.Args[2]) + board := util.InputParserBytes(os.Args[2]) changed := true for changed { diff --git a/2020/day12.go b/2020/day12.go index aba0432..a4f72f2 100644 --- a/2020/day12.go +++ b/2020/day12.go @@ -6,7 +6,7 @@ import ( "os" "strconv" - "git.annabunch.es/annabunches/adventofcode/2020/lib/fileutils" + "git.annabunch.es/annabunches/adventofcode/2020/lib/util" ) func distance(x1, y1, x2, y2 int) int { @@ -133,7 +133,7 @@ func step2(values []string) (int, int) { func main() { step := os.Args[1] - values := fileutils.InputParserStrings(os.Args[2]) + values := util.InputParserStrings(os.Args[2]) x := 0 y := 0 diff --git a/2020/day13.go b/2020/day13.go index 21d2c3b..d245452 100644 --- a/2020/day13.go +++ b/2020/day13.go @@ -9,7 +9,7 @@ import ( "strconv" "strings" - "git.annabunch.es/annabunches/adventofcode/2020/lib/fileutils" + "git.annabunch.es/annabunches/adventofcode/2020/lib/util" ) // @@ -108,7 +108,7 @@ func findTimestampWithCRT(busList []int) *big.Int { func main() { step := os.Args[1] - values := fileutils.InputParserStrings(os.Args[2]) + values := util.InputParserStrings(os.Args[2]) earliest, busList := parseInput(values) diff --git a/2020/day14.go b/2020/day14.go index 694d834..f40ff94 100644 --- a/2020/day14.go +++ b/2020/day14.go @@ -7,7 +7,7 @@ import ( "regexp" "strconv" - "git.annabunch.es/annabunches/adventofcode/2020/lib/fileutils" + "git.annabunch.es/annabunches/adventofcode/2020/lib/util" ) type Instruction struct { @@ -140,7 +140,7 @@ func executeProgram2(program []Instruction) map[int64]int64 { func main() { step := os.Args[1] - values := fileutils.InputParserStrings(os.Args[2]) + values := util.InputParserStrings(os.Args[2]) var memory map[int64]int64 program := parseProgram(values, step) diff --git a/2020/lib/fileutils/fileutils.go b/2020/lib/util/file.go similarity index 98% rename from 2020/lib/fileutils/fileutils.go rename to 2020/lib/util/file.go index 506cc15..bbf9196 100644 --- a/2020/lib/fileutils/fileutils.go +++ b/2020/lib/util/file.go @@ -1,4 +1,4 @@ -package fileutils +package util import ( "bufio" diff --git a/2020/template.go b/2020/template.go index 537bd59..d92496a 100644 --- a/2020/template.go +++ b/2020/template.go @@ -4,11 +4,11 @@ import ( "fmt" "os" - "git.annabunch.es/annabunches/adventofcode/2020/lib/fileutils" + "git.annabunch.es/annabunches/adventofcode/2020/lib/util" ) func main() { // step := os.Args[1] - values := fileutils.InputParserStrings(os.Args[2]) + values := util.InputParserStrings(os.Args[2]) }