Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gc0rreiab committed Dec 18, 2022
1 parent 9b6f35a commit 81fd885
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion day2_rock-paper-scissors/challenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ def scoreCalculation(self):
for line in lines:
l = line.split()

#Solve part 1
l[0] = 'R' if l[0]=='A' else 'P' if l[0]=='B' else 'S'
l[1] = 'R' if l[1]=='X' else 'P' if l[1]=='Y' else 'S'
r = Round(l[0], l[1])
r.scoreCalculation()
totalScore1 = totalScore1 + r.score

#Solve parte 2
#Solve part 2
if l[1] == 'R':
#need to lose
l[1] = 'P' if l[0]=='S' else 'R' if l[0]=='P' else 'S'
Expand Down
4 changes: 4 additions & 0 deletions day3_Rucksack-Reorganization/challenge.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def __init__ (self, items):
def findError(self):
e = list(set(self.compartments1) & set(self.compartments2))
self.error = e[0]
#calculate the priority
if self.error.isupper():
self.priorities = ord(self.error) - 38
else:
Expand All @@ -35,3 +36,6 @@ def findError(self):



# Elfs are devided into groups of three


0 comments on commit 81fd885

Please sign in to comment.