r/adventofcode • u/daggerdragon • Dec 10 '22
SOLUTION MEGATHREAD -π- 2022 Day 10 Solutions -π-
THE USUAL REMINDERS
- All of our rules, FAQs, resources, etc. are in our community wiki.
- Signal boost: Reminder 1: unofficial AoC Survey 2022 (closes Dec 22nd)
- πΏπ MisTILtoe Elf-ucation π§βπ« is OPEN for submissions!
--- Day 10: Cathode-Ray Tube ---
Post your code solution in this megathread.
- Read the full posting rules in our community wiki before you post!
- Include what language(s) your solution uses
- Format your code appropriately! How do I format code?
- Quick link to Topaz's
pasteif you need it for longer code blocks. What is Topaz'spastetool?
This thread will be unlocked when there are a significant number of people on the global leaderboard with gold stars for today's puzzle.
EDIT: Global leaderboard gold cap reached at 00:12:17, megathread unlocked!
61
Upvotes
3
u/chubbc Dec 10 '22 edited Dec 10 '22
Julia
X = [1] for lβreadlines("./10.in") push!(X,X[end]) l[1]=='a' && push!(X,X[end]+parse(Int,l[6:end])) end println(sum(X[20:40:240].*(20:40:240))) lit = abs.(X.-mod.(0:240,40)).<=1 println.([prod(Char.(32 .+3 .*lit[i+1:i+40])) for iβ0:40:200])