Completed first day successful
This commit is contained in:
18
Day0/doorOne.py
Normal file
18
Day0/doorOne.py
Normal file
@@ -0,0 +1,18 @@
|
||||
file = open('/Users/mastermito/Dev/AdventOfCode/Day0/input.txt', 'r')
|
||||
|
||||
#start of dial
|
||||
number = 50
|
||||
#counter for zeros
|
||||
counter = 0
|
||||
|
||||
lines = file.readlines()
|
||||
|
||||
for line in lines:
|
||||
step = int(line[1:])
|
||||
direction = 1 if line.startswith('R') else -1;
|
||||
|
||||
number = (number + (direction * step)) % 100
|
||||
|
||||
print('counter:', counter)
|
||||
|
||||
file.close()
|
||||
Reference in New Issue
Block a user