r/adventofcode • u/daggerdragon • Dec 13 '21
SOLUTION MEGATHREAD -🎄- 2021 Day 13 Solutions -🎄-
Advent of Code 2021: Adventure Time!
- 10 days left to submit your adventures!
- Full details and rules are in the submissions megathread: 🎄 AoC 2021 🎄 [Adventure Time!]
--- Day 13: Transparent Origami ---
Post your code solution in this megathread.
- Include what language(s) your solution uses!
- Format your code appropriately! How do I format code?
- Here's a quick link to /u/topaz2078's
pasteif you need it for longer code blocks. - 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 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!
38
Upvotes
View all comments
Show parent comment
1
u/tom_collier2002 Dec 13 '21 edited Dec 13 '21
I wrote the OCR code after initially printing out the result using
#and.characters. It felt like reading a Captcha (Is that aUor aV?! I sweat I'm not a bot!). A few coworkers also posted their part 2 results in a similar format, which gave me examples of roughly half the alphabet to "train" my OCR code with. About half of the remaining letters were pretty easy to guess at (though they could still be wrong).Finally, since we only have a 4 "pixel" width, characters like
MandWdidn't have enough width for all the required detail. Also, vertically symmetric characters likeI,TandYwould look better using an odd pixel width so I either had to leave a column unused or make the character asymmetrical around the vertical axis.Edit: the OCR fails on the sample input as the
Ocharacter has a width of 5 pixels :(