Days 7,8,9

This commit is contained in:
gareth
2023-12-09 21:38:21 +00:00
parent 7e3eae9e60
commit d730b7ff9d
14 changed files with 1586 additions and 119 deletions

View File

@@ -0,0 +1,25 @@
package day09
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestPart1(t *testing.T) {
r := Part1(`AAA = (BBB, BBB)
BBB = (AAA, ZZZ)
ZZZ = (ZZZ, ZZZ)`)
assert.Equal(t, 6, r)
}
func TestPart2(t *testing.T) {
r := Part2(`11A = (11B, XXX)
11B = (XXX, 11Z)
11Z = (11B, XXX)
22A = (22B, XXX)
22B = (22C, 22C)
22C = (22Z, 22Z)
22Z = (22B, 22B)
XXX = (XXX, XXX)`)
assert.Equal(t, 6, r)
}