dumping 5 days of unrefined solutions :)

This commit is contained in:
alexchao26
2022-12-20 01:06:57 -05:00
parent d9e783478b
commit f3396ea86a
10 changed files with 1045 additions and 0 deletions
+67
View File
@@ -0,0 +1,67 @@
package main
import (
"testing"
)
var example = ` [D]
[N] [C]
[Z] [M] [P]
1 2 3
move 1 from 2 to 1
move 3 from 1 to 3
move 2 from 2 to 1
move 1 from 1 to 2`
func Test_part1(t *testing.T) {
tests := []struct {
name string
input string
want string
}{
{
name: "example",
input: example,
want: "CMZ",
},
{
name: "actual",
input: input,
want: "QNHWJVJZW",
},
}
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 string
}{
{
name: "example",
input: example,
want: "MCD",
},
{
name: "actual",
input: input,
want: "BPCZJLFJW",
},
}
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)
}
})
}
}