Skip to content

Commit

Permalink
2022 Day 06 Atari solution down to 9s/16s by jumping ahead more if du…
Browse files Browse the repository at this point in the history
…plicate found far down array
  • Loading branch information
markjfisher committed Dec 6, 2022
1 parent 8a00732 commit ec3904f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Binary file modified atari/2022/aoc2206-solution.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions atari/2022/aoc2206.bas
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ data b. = "mqnlnqnjnfpgfvrhsbzhjftmvzrzpqpmlcbnwmbssmvssmmqpvwnsjppdhmn
data b. = "wwthjddjmsdnjmzhhpjdllgscdrgmhfpljfzsmszqsqqgrznddhfmstzdcqpgztgwwqpvrghtmqlgdddlqqwwwtnpldbqtf"

dim d(15) b.
p_start = 1

stime = time
exec find_marker 4
Expand Down Expand Up @@ -90,5 +91,7 @@ proc unique_count s
found_seq = 1
else
found_seq = 0
' we can jump ahead a few more chars if we found a match later on
p_start = p_start + j - 1
endif
endproc

0 comments on commit ec3904f

Please sign in to comment.