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

December 2

Listening to: DOS video game music


This year I have like five advent things going at once:

  • Advent of Code (basically this)
  • Hot chocolate advent calendar
  • Whiskey Advent Calendar
  • Cosmetics (more for my partner though)
  • A Tea advent calendar my mom gave me

It almost feels overwhelming, but it makes every day in December something to look forward to. Especially in the evenings. My plans are essentially to de-stress in the afternoon with some tea and sit with the dog; try some whiskey when the sun goes down or with dinner; do Advent of Code around release; and watch an episode of Deep Space 9, as that show is just super cozy for some reason. I just hope I don't get stressed out or overloaded this year from it all.


Rock-paper-scissors. Easy enough. Even more, I don't need to 'play', just figure out what the results are with asusmptions for what goes on based on the input. ABC vs XYZ. I tried to think of something clever... but I just hardcoded it, since sometimes that's just the best. Spent most of the time figuring out what the scores were supposed to be. (Scores changed below because... why not)

switch(line[0]) {
    case 'A':
        switch(line[2]) {
            case 'X': score += 1; break;
            case 'Y': score += 2; break;
            case 'Z': score += 3; break;
        }
        break;

    case 'B':
        // more scores

    case 'C':
        // more scores
}

Even better, this worked well for part two. I just needed to re-order which scores happened in each case, as the goal was to figure out what I needed to win/draw/lose in the XYZ case.

I did this pretty quick too... I should add a thing to guage how quick I did these? I would have to figure out backwards for last year too though. Eh. Why not? Added it to the bottom.


Time taken: 10 minutes

My solutions for today's puzzles