Skip to content

Instantly share code, notes, and snippets.

@pawlos
Created December 17, 2017 15:10
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/c8456415e7e944476c9cf3b1ee8f8569 to your computer and use it in GitHub Desktop.
Save pawlos/c8456415e7e944476c9cf3b1ee8f8569 to your computer and use it in GitHub Desktop.
Solution to Day 17: Spinlock - Part 2
#aoc_d17.py
spin = 371
solution = []
solution.append(0)
index = 0
l = 1
for i in range(1,50000000):
index += spin
index %= l
if index == 0:
print i
l += 1
index += 1
print 'done'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment