From 6b00c07daee92eb797c8e0c5c02ca94fccc730a4 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sat, 25 Dec 2021 11:18:14 -0600 Subject: [PATCH] Present time --- 2021/nim/day25.nim | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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