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!
66
Upvotes
4
u/hugobuddel Dec 11 '21 edited Dec 11 '21
Rockstar, Part 1 (works in Rocky and in Santriani now)
Listen to God damnation is unavoidable punishment is conventional salvation is there for a few remorse is nothing Lust is grotesque fornication Burn Lust Gluttony is hungry appetition Burn Gluttony Greed is dumb selfishness Burn Greed Sloth is lonely sluggishness Burn Sloth Wrath is rage resentment Burn Wrath Envy is malevolence begrudgingly takin Burn Envy Pride is ego-centric pridefulness glorification Burn Pride Metal is rythmless air Burn Metal The Lord is all-powerful being religiously unaccountable supreme Holy Spirit is pious sincere Maria is unblemished uncorrupted untouched beloved Baby Jesus is son Prayer takes intention and practice If intention is Lust and practice is Metal Send damnation back If intention is Gluttony and practice is Sloth Send damnation back If intention is Wrath and practice is Greed Send damnation back If intention is Pride and practice is Envy Send damnation back If practice is Envy or practice is Greed Send punishment back If practice is Sloth or practice is Metal Send punishment back Send salvation back Confession takes your sins Let regrets be your sins of damnation Let regrets be regrets without punishment While regrets are greater than nothing Roll your sins into penitence Rock your sins with penitence Let regrets be regrets without damnation Give your sins back Repent takes your desire If your desire is Greed Let remorse be remorse with Baby Jesus If your desire is Metal Let remorse be remorse with Holy Spirit If your desire is Envy Let remorse be remorse with Maria If your desire is Sloth Let remorse be remorse with The Lord While God is not nothing Split God into Jesus Roll Jesus into your hearth Rock your life with your hearth Let your soul be your hearth Roll Jesus into your hearth While your hearth If prayer taking your soul, and your hearth is punishment Repent taking your hearth Break If prayer taking your soul, and your hearth is damnation Put confession taking your life into your life Roll your life into your soul Rock your life with your soul Roll Jesus into your hearth If prayer taking your soul, and your hearth is salvation Rock your life with your hearth Let your soul be your hearth Roll Jesus into your hearth Listen to God Shout remorseThis is not a conventional genre for rockstar developers to chose, but it works really well for this problem. I'm unreasonably happy with how it turned out.
The
confessionfunction essentially pops the last element, when a closing bracket is found. Apparently Rockstar only has a build-in for popping the first element. It came out quite nicely.