2021 day11: fun game of life ish thing

This commit is contained in:
alexchao26
2021-12-11 12:29:05 -05:00
parent 46d1c4a5a9
commit f32239d2cb
2 changed files with 179 additions and 0 deletions
+57
View File
@@ -0,0 +1,57 @@
package main
import (
"testing"
)
var example = `5483143223
2745854711
5264556173
6141336146
6357385478
4167524645
2176841721
6882881134
4846848554
5283751526`
func Test_flashingOctopiLol(t *testing.T) {
tests := []struct {
name string
input string
part int
want int
}{
{
name: "example",
input: example,
part: 1,
want: 1656,
},
{
name: "actual",
input: input,
part: 1,
want: 1723,
},
{
name: "example",
input: example,
part: 2,
want: 195,
},
{
name: "actual",
input: input,
part: 2,
want: 327,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := flashingOctopiLol(tt.input, tt.part); got != tt.want {
t.Errorf("flashingOctopiLol() = %v, want %v", got, tt.want)
}
})
}
}