day20, starting to read in data

with using tests as entry points for checking things
This commit is contained in:
efim
2023-12-20 07:35:51 +00:00
parent e771ac9d9b
commit 9dbc2ca205
4 changed files with 179 additions and 15 deletions

23
main.go
View File

@@ -2,25 +2,18 @@ package main
import (
"log"
"time"
"sunshine.industries/aoc2023/day19"
"sunshine.industries/aoc2023/day20"
)
func main() {
startTime := time.Now()
log.Print("> starting run:")
// lnx{m>1548:A,A}
// qqz{s>2770:qs,m<1801:hdj,R}
// kt{m>2215:R,x>3386:A,x<3107:R,R}
testSorter := day19.ReadSorterLine("kt{m>2215:R,x>3386:A,x<3107:R,R}")
log.Printf("my test sorter is %+v", testSorter)
simplified := day19.SimplifyOperation(testSorter)
log.Printf("> simplivied %+v", simplified)
detail := day19.ReadDetailLine("{x=787,m=2655,a=1222,s=2876}")
log.Printf("> detail %+v", detail)
result := day19.Run()
log.Printf("\n\nday19 result: %d\n****\n", result)
result := day20.Run()
log.Printf("\n\nday20 result: %d\n****\n", result)
endTime := time.Now()
diff := endTime.Sub(startTime)
log.Printf("execution took %s", diff.String())
}