advent-of-code/2021/nim/day25.nim

22 lines
562 B
Nim
Raw Normal View History

2021-12-25 11:18:14 -06:00
import ./common, std/[strutils, sequtils, tables, strformat, algorithm, hashes]
2021-12-25 00:19:28 -06:00
proc p1(input: Lines): uint64 =
2021-12-25 11:18:14 -06:00
var cukes = input
while cukes.hash != nextCukes.hash
var nextCukes = cukes
for y,line in cukes:
for x,c in cukes:
case c:
# don't forget to wrap
of '>': # TODO: check next x
of 'v': # TODO: check next y
else: continue
cukes = nextCukes
inc result
2021-12-25 00:19:28 -06:00
proc p2(input: Lines): uint64 =
2021-12-25 00:19:50 -06:00
0
2021-12-25 00:19:28 -06:00
2021-12-25 00:19:50 -06:00
time(&"Day 25 Part 1"): echo 25.loadInput.p1
time(&"Day 25 Part 2"): echo 25.loadInput.p2