Skip to content

Commit

Permalink
Use less memory so tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
Akuli committed Jan 4, 2025
1 parent 26bcad3 commit 6d0a617
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/aoc2024/day22/part2.jou
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def diffseq_to_int(diffseq: int[4]) -> int:

class Buyer:
seed: long
diffseq_to_bananas: int*
diffseq_to_bananas: byte*

def init_from_seed(self) -> None:
last_digits: int[2000]
Expand All @@ -59,7 +59,7 @@ class Buyer:
# Go backwards so that we overwrite with whatever appears first in array
for i = 1999; i >= 3; i--:
diffseq = [deltas[i-3], deltas[i-2], deltas[i-1], deltas[i]]
self->diffseq_to_bananas[diffseq_to_int(diffseq)] = last_digits[i]
self->diffseq_to_bananas[diffseq_to_int(diffseq)] = last_digits[i] as byte


def main() -> int:
Expand Down

0 comments on commit 6d0a617

Please sign in to comment.