diff --git a/2021/nim/day25.nim b/2021/nim/day25.nim index eeaa766..0556c12 100644 --- a/2021/nim/day25.nim +++ b/2021/nim/day25.nim @@ -1,7 +1,18 @@ -import ./common, std/[strutils, sequtils, tables, strformat, algorithm] +import ./common, std/[strutils, sequtils, tables, strformat, algorithm, hashes] proc p1(input: Lines): uint64 = - 0 + 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 proc p2(input: Lines): uint64 = 0