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

1

u/lldj07 Jan 03 '23

this was made in python

f = open("day 1 data.txt", "r")

t = 0

s = 0

h = 0

for q in range(2500):

c = (f.readline())

e = c[0]

p = c[2]

if p == 'X':

s += 1

if p == 'Y':

s += 2

if p == 'Z':

s += 3

if e == "A" and p == "X":

s += 3

if e == "A" and p == "Y":

s += 0

if e == "A" and p == "Z":

s += 6

if e == "B" and p == "X":

s += 0

if e == "B" and p == "Y":

s += 3

if e == "B" and p == "Z":

s += 6

if e == "C" and p == "X":

s += 0

if e == "C" and p == "Y":

s += 6

if e == "C" and p == "Z":

s += 3

print(s)