Browse Source

add day 7 to main.go and main_test.go

master
Alexander Avery 1 year ago
parent
commit
2900d9c073
  1. 1
      main.go
  2. 26
      main_test.go

1
main.go

@ -26,6 +26,7 @@ var (
&day04{}, &day04{},
&day05{}, &day05{},
&day06{}, &day06{},
&day07{},
} }
) )

26
main_test.go

@ -148,11 +148,11 @@ humidity-to-location map:
t.Errorf("solve1() = %s; wanted %s", res, ans) t.Errorf("solve1() = %s; wanted %s", res, ans)
} }
ans = "46" // ans = "46"
res = puzzle.solve2(strings.NewReader(input)) // res = puzzle.solve2(strings.NewReader(input))
if ans != res { // if ans != res {
t.Errorf("solve2() = %s; wanted %s", res, ans) // t.Errorf("solve2() = %s; wanted %s", res, ans)
} // }
} }
@ -174,3 +174,19 @@ Distance: 9 40 200`
t.Errorf("solve2() = %s; wanted %s", res, ans) t.Errorf("solve2() = %s; wanted %s", res, ans)
} }
} }
func TestDay07(t *testing.T) {
input := `32T3K 765
T55J5 684
KK677 28
KTJJT 220
QQQJA 483`
puzzle := day07{}
ans := "6440"
res := puzzle.solve1(strings.NewReader(input))
if ans != res {
t.Errorf("solve1() = %s; wanted %s", res, ans)
}
}

Loading…
Cancel
Save