From fe75c10e350743a1c078f065d69556fecf825ca5 Mon Sep 17 00:00:00 2001 From: nekineki Date: Sun, 11 Dec 2022 14:47:27 +0100 Subject: move files around, update paths --- 2022/day2/day2.py | 62 ------------------------------------------------------- 1 file changed, 62 deletions(-) delete mode 100755 2022/day2/day2.py (limited to '2022/day2/day2.py') diff --git a/2022/day2/day2.py b/2022/day2/day2.py deleted file mode 100755 index 727bb31..0000000 --- a/2022/day2/day2.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python3 - -import math -import time - -score1 = 0 -score2 = 0 - -# filename = "input_test.txt" -filename = "input.txt" -with open(filename) as f: - for line in f: - line = line.strip() - abc, xyz = line[0], line[2] - - if abc == 'A': - abc = 1 - elif abc == 'B': - abc = 2 - elif abc == 'C': - abc = 3 - else: - print('ERROR') - - if xyz == 'X': - xyz = 1 - elif xyz == 'Y': - xyz = 2 - elif xyz == 'Z': - xyz = 3 - else: - print('ERROR') - - s1 = 0 - if abc == xyz: - print('draw') - s1 = 3 + xyz - # elif ((xyz + 1)%3) + 1 == abc: - elif abc%3 + 1 == xyz: - print('win') - s1 = 6 + xyz - else: - print('lose') - s1 = 0 + xyz - print('s1', s1) - score1 += s1 - - if xyz == 1: - # lose - s2 = 0 + (abc-1 + 2)%3 + 1 - elif xyz == 2: - # draw - s2 = 3 + abc - elif xyz == 3: - # win - s2 = 6 + (abc-1 + 1)%3 + 1 - print('s2', s2) - score2 += s2 - - print('score1', score1) - print('score2', score2) - -- cgit v1.2.3