Initial setup

This commit is contained in:
2020-12-06 23:33:55 +01:00
parent 719c643b03
commit e011ff8444
13 changed files with 2817 additions and 0 deletions

23
Scripts/Day3_1.py Normal file
View File

@@ -0,0 +1,23 @@
xPosition = 0
treesEncounterd = 0
def makeStep():
global xPosition
if xPosition+3 >= map[0].__len__():
xPosition = (xPosition+3) - map[0].__len__()
else :
xPosition += 3
f = open("Ressources/InputDay3.txt", 'r')
map = [f.strip() for f in f.readlines()]
deepestLevel = map.__len__()
for i in range(1,deepestLevel):
makeStep()
if map[i][xPosition] == '#':
treesEncounterd += 1
print(treesEncounterd)