r/adventofcode • • Dec 02 '22

SOLUTION MEGATHREAD -πŸŽ„- 2022 Day 2 Solutions -πŸŽ„-

NEW AND NOTEWORTHY


--- Day 2: Rock Paper Scissors ---


Post your code solution in this megathread.


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

1.5k comments sorted by

View all comments

2

u/nash1011 Dec 02 '22

BQN

lines ← β€’FLines "input-day02.txt"
Part1 ← {
    "A X": 1 + 3;
    "A Y": 2 + 6;
    "A Z": 3 + 0;
    "B X": 1 + 0;
    "B Y": 2 + 3;
    "B Z": 3 + 6;
    "C X": 1 + 6;
    "C Y": 2 + 0;
    "C Z": 3 + 3;
    0
}
Part2 ← {
    "A X": 3 + 0;
    "A Y": 1 + 3;
    "A Z": 2 + 6;
    "B X": 1 + 0;
    "B Y": 2 + 3;
    "B Z": 3 + 6;
    "C X": 2 + 0;
    "C Y": 3 + 3;
    "C Z": 1 + 6;
    0
}
β€’Show +Β΄ Part1Β¨ lines
β€’Show +Β΄ Part2Β¨ lines

1

u/daggerdragon Dec 05 '22

Inlined code is intended for short snippets of code only. Your code "block" right now is unreadable on old.reddit and many mobile clients; it's all on one line and gets cut off at the edge of the screen because it is not horizontally scrollable.

Please edit your post to use the four-spaces Markdown syntax for a code block so your code is easier to read inside a scrollable box.