r/adventofcode • u/daggerdragon • Dec 03 '20
SOLUTION MEGATHREAD -🎄- 2020 Day 03 Solutions -🎄-
Advent of Code 2020: Gettin' Crafty With It
- T-3 days until unlock!
- Full details and rules are in the Submissions Megathread
--- Day 03: Toboggan Trajectory ---
Post your solution in this megathread. Include what language(s) your solution uses! If you need a refresher, the full posting rules are detailed in the wiki under How Do The Daily Megathreads Work?.
Reminder: Top-level posts in Solution Megathreads are for solutions only. If you have questions, please post your own thread and make sure to flair it with Help.
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:04:56, megathread unlocked!
89
Upvotes
View all comments
Show parent comment
2
u/CotswoldWanker Dec 04 '20
Hey Jonathan, I enjoyed the video. Thanks for sharing. I have a question for you, if you don't mind.
I cannot wrap my head around why using modulus works here:
I can see how it works, and it's a great solution for "widening" the map (shamefully, for my solution I just multiplied each row by 100...), but I don't understand enough about modulus to see how you came to the idea of using it for this. Could you possibly break down why modulus works for this solution for me?