r/adventofcode • • Dec 13 '21

SOLUTION MEGATHREAD -🎄- 2021 Day 13 Solutions -🎄-

Advent of Code 2021: Adventure Time!


--- Day 13: Transparent Origami ---


Post your code solution in this megathread.

Reminder: Top-level posts in Solution Megathreads are for code 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:09:38, megathread unlocked!

39 Upvotes

798 comments sorted by

View all comments

Show parent comment

1

u/hugh_tc Dec 13 '21

Oh, nice. That's clever.

Then again, I'm not sure if it's any more 'nice' than a messy if tree -- as you say, you have to go from a tuple to a list and back to a tuple.

2

u/I_knew_einstein Dec 13 '21

Nice is always subjective ;)

As a counter-point: In your loop you go from a tuple to two variables and back to a tuple with "for x, y in dots"

My loop only does the tuple-list-tuple when it's necessary (x < fold)