Skip to content

Instantly share code, notes, and snippets.

@pawlos
Last active December 24, 2017 18:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pawlos/908e808e6b1b1c31703e06447602cc55 to your computer and use it in GitHub Desktop.
Save pawlos/908e808e6b1b1c31703e06447602cc55 to your computer and use it in GitHub Desktop.
Solution to Day 5: A Maze of Twisty Trampolines, All Alike
lines = open('input_d5.txt','r').readlines()
#lines = ["0","3","0","1","-3"]
inputs = [int(l) for l in lines]
i = 0
cnt = 0
while True:
s = inputs[i]
inputs[i] += 1
cnt += 1
if i + s >= len(inputs) or i+s<0:
break
#print s, i, inputs
i += s
print cnt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment