2020-day15 so close :( 600/209. difficult to just understand the prompt. brute forced a dictionary for pt 2

2017-day10 weird fake hashing, xor and hexadecimals
This commit is contained in:
alexchao26
2020-12-14 23:58:27 -05:00
parent 0bc9afb7e0
commit 1e2a250acd
4 changed files with 211 additions and 46 deletions
+14 -24
View File
@@ -2,38 +2,28 @@ package main
import (
"testing"
"time"
"github.com/alexchao26/advent-of-code-go/util"
)
func Test_part1(t *testing.T) {
func Test_rambunctiousRecitation(t *testing.T) {
tests := []struct {
name string
input string
want int
name string
input string
desiredStep int
want int
}{
// {"actual", util.ReadFile("input.txt"), ACTUAL_ANSWER},
{"actual", util.ReadFile("input.txt"), 2020, 1259},
{"actual", util.ReadFile("input.txt"), 30000000, 689},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := part1(tt.input); got != tt.want {
t.Errorf("part1() = %v, want %v", got, tt.want)
}
})
}
}
func Test_part2(t *testing.T) {
tests := []struct {
name string
input string
want int
}{
// {"actual", util.ReadFile("input.txt"), ACTUAL_ANSWER},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := part2(tt.input); got != tt.want {
t.Errorf("part2() = %v, want %v", got, tt.want)
startTime := time.Now()
if got := rambunctiousRecitation(tt.input, tt.desiredStep); got != tt.want {
t.Errorf("rambunctiousRecitation() = %v, want %v", got, tt.want)
}
t.Log("Op time: ", time.Since(startTime))
})
}
}