Browse Source

started daystarted day9

main
Luna Lailatova 2 years ago
parent
commit
09d368083d
  1. 39
      day9.py
  2. 2000
      input9.txt

39
day9.py

@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
def expandGrid(direct):
if direct == "U":
gridVisited.append(0, [])
for _ in range(len(gridVisited[1]))
gridVisited[0].append('.')
elif direct == "R"
for i in range(len(gridVisited))
gridVisited[i].append('.')
elif direct == "D"
gridVisited.append([])
tempx = len(gridVisited) - 1
for _ in range(len(gridVisited[0]))
gridVisited[tempx].append('.')
elif direct == "L"
for i in range(len(gridVisited))
gridVisited[i].append('.')
gridVisited =[['#']]
posHead =
posTail =
with open('input9.txt','r') as f:
inp = f.read().splitlines(keepends=False)
direction = []
distance = []
for i in inp:
tempa, tempb = i.split(' ')
direction.append(tempa)
distance.append(tempb)
for x in range(len(direction)):
if direction[x] == 'U':
elif direction[x] == 'R':
elif direction[x] == 'D':
elif direction[x] == 'L':

2000
input9.txt

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save