From 92ff666ae2fcc19810d31e16fcd893a342265d1d Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Fri, 15 Dec 2023 01:37:15 +0000 Subject: [PATCH] fix index --- day-14/two.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/day-14/two.go b/day-14/two.go index 06d7d8b..f29da8d 100644 --- a/day-14/two.go +++ b/day-14/two.go @@ -32,8 +32,8 @@ func cycleMany(image img, iterations int) { copy(cachedImages[i+1], image.raw) } - period := i - start // length of a full period - copy(image.raw, cachedImages[start+((iterations-i-1)%period)]) // copy cachedImage into image.raw + period := i - start // length of a full period + copy(image.raw, cachedImages[start+((iterations-i-1)%period)+1]) // copy cachedImage into image.raw } // two returns the load of all boulders after 1000000000 cycles