2020-day14: bitwise nonsense but got there eventually... ~2500?

This commit is contained in:
alexchao26
2020-12-14 01:33:14 -05:00
parent 7b59c510d8
commit eb4f03269d
2 changed files with 108 additions and 19 deletions
+10 -2
View File
@@ -2,6 +2,8 @@ package main
import (
"testing"
"github.com/alexchao26/advent-of-code-go/util"
)
func Test_part1(t *testing.T) {
@@ -10,7 +12,7 @@ func Test_part1(t *testing.T) {
input string
want int
}{
// {"actual", util.ReadFile("input.txt"), ACTUAL_ANSWER},
{"actual", util.ReadFile("input.txt"), 14925946402938},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
@@ -21,13 +23,19 @@ func Test_part1(t *testing.T) {
}
}
var example = `mask = 000000000000000000000000000000X1001X
mem[42] = 100
mask = 00000000000000000000000000000000X0XX
mem[26] = 1`
func Test_part2(t *testing.T) {
tests := []struct {
name string
input string
want int
}{
// {"actual", util.ReadFile("input.txt"), ACTUAL_ANSWER},
{"example", example, 208},
{"actual", util.ReadFile("input.txt"), 3706820676200},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {