r/adventofcode • u/daggerdragon • Dec 10 '21
SOLUTION MEGATHREAD -🎄- 2021 Day 10 Solutions -🎄-
--- Day 10: Syntax Scoring ---
Post your code solution in this megathread.
- Include what language(s) your solution uses!
- Here's a quick link to /u/topaz2078's
pasteif you need it for longer code blocks. - Format your code properly! How do I format code?
- 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:08:06, megathread unlocked!
65
Upvotes
View all comments
Show parent comment
7
u/duncan-udaho Dec 10 '21 edited Dec 13 '21
Man, I gotta get better with Rust. Yours looks sooooo much cleaner than mine.
I didn't know you could do a multi match like that (
match c { '('|'['|'{'|'<' => ...) and I have yet to usefoldsuccessfully without reference, so I'll give that a try here tomorrow.I really just wanted to comment on your post to say thanks. I've been finishing each puzzle on my own, then I commit it, but afterward I go back and refactor using all the tips I pick up from this thread. I've been referencing your posts a lot for that refactoring, and have learned a bit from you so far, so thanks! I appreciate you posting this.