mirror of
https://github.com/Threnklyn/advent-of-code-go.git
synced 2026-06-07 12:45:10 +02:00
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:
+14
-24
@@ -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))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user