mirror of
https://github.com/onyx-and-iris/aoc2023.git
synced 2024-11-15 15:10:49 +00:00
fix index
This commit is contained in:
parent
219bb3884b
commit
92ff666ae2
@ -32,8 +32,8 @@ func cycleMany(image img, iterations int) {
|
|||||||
copy(cachedImages[i+1], image.raw)
|
copy(cachedImages[i+1], image.raw)
|
||||||
}
|
}
|
||||||
|
|
||||||
period := i - start // length of a full period
|
period := i - start // length of a full period
|
||||||
copy(image.raw, cachedImages[start+((iterations-i-1)%period)]) // copy cachedImage into image.raw
|
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
|
// two returns the load of all boulders after 1000000000 cycles
|
||||||
|
Loading…
Reference in New Issue
Block a user