You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
614 B
Python
22 lines
614 B
Python
from entities.elf import Elf
|
|
from rockpaperscissor.file.guide_list import RockPaperScissorGuide
|
|
|
|
if __name__ == "__main__":
|
|
my_elf = Elf()
|
|
other_elf = Elf()
|
|
rounds = RockPaperScissorGuide("./input/day2/input.lst").parse_file()
|
|
scores = []
|
|
for other, own in rounds:
|
|
result, score = my_elf.evaluate_RPS_round(other, own)
|
|
scores.append(score)
|
|
if result:
|
|
r = "won"
|
|
else:
|
|
r = "lost"
|
|
print(f"Elf {my_elf} played {own} against {other} and {r} with {score} points!")
|
|
|
|
print()
|
|
print(f"I've got a total of {sum(scores)} points!")
|
|
|
|
|