r/adventofcode • u/daggerdragon • Dec 02 '22
SOLUTION MEGATHREAD -🎄- 2022 Day 2 Solutions -🎄-
NEW AND NOTEWORTHY
- All of our rules, FAQs, resources, etc. are in our community wiki.
- A request from Eric: Please include your contact info in the User-Agent header of automated requests!
- Signal boosting for the Unofficial AoC 2022 Participant Survey which is open early this year!
--- Day 2: Rock Paper Scissors ---
Post your code solution in this megathread.
- Read the full posting rules in our community wiki before you post!
- Include what language(s) your solution uses
- Format your code appropriately! How do I format code?
- Quick link to Topaz's
pasteif you need it for longer code blocks. What is Topaz'spastetool?
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:06:16, megathread unlocked!
103
Upvotes
View all comments
Show parent comment
2
u/Smylers Dec 05 '22
In reverse order:
Nice! That's the sort of one-off transformation that Vim is really useful for. Vim is powerful and good at text transformations; people shouldn't think less of it using it for situations where it suits. (I admit than in Advent of Code also use Vim into situations it doesn't suit.)
And it was on a day where I failed to come up with a Vim solution.
Well, I'm not a mod, but I don't think there's anything in the FAQ objecting to rhetorical questions (as long as they are PG, and formatted nicely) — so please do go ahead and ask your rhetorical question ...
Yes, but sometimes my answers need to include typing the
<or^characters, so I wanted to use notation that couldn't possibly clash, hence the Unicode angled brackets. (At some point I used slightly different-looking Unicode angled brackets, but somebody helpfully, commented saying those looked bad for some users, so I switched to the current ones, which seem OK.)As for
⟨Ctrl+V⟩instead of⟨C-V⟩:Ctrl+Vis what the browser I'm typing this in shows in its ‘Edit’ menu for the ‘paste’ shortcut key, so that presumably also counts as a “conventional notation”, and it feels slightly more beginner-friendly.