FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
karfau

karfau

aoc23_08

Remix of karfau/aocXX_00
Public
Like
aoc23_08
Home
Code
2
README.md
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
Code
/
Search
README.md

https://adventofcode.com/2023/day/8

the script times out on val.town, so I ran it with deno on my machine for some mintes.

By running

deno run https://esm.town/v/karfau/aoc23_08 | grep z

I observed a repeating pattern in the output...

each "track" was reaching the same position over and over again, but not on the same lines.

I dumped the beginning of the output into a text file, opened it to look at the patterns and confirmed that each "track" had a fixed frequency for each position ending on a Z.

so I took the "step"(+1 because it's zero based) and checked the primes each of them contains, to get the correct input. I calculated that with a calculator and copied in the number.

Migrated from folder: adventofcode/_2023/aoc23_08

Code
README.mdmain.tsx
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareersBrandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.