commit 788c5d6058ef3e3242e49f89067a5d2060b4a901 parent 77fd00b8a91b0d7da2a81456cea353431087a4ac Author: mpizzzle <michael.770211@gmail.com> Date: Sun, 17 Dec 2017 21:40:49 +0000 puzzle 17 complete Diffstat:
| M | puzzle17.py | | | 7 | +++++++ |
1 file changed, 7 insertions(+), 0 deletions(-)
diff --git a/puzzle17.py b/puzzle17.py @@ -8,3 +8,10 @@ for i in range(1, 2018): spinlock_buffer.insert(ptr, i) print spinlock_buffer[ptr + 1] + +ptr = 0 + +for i in range(1, 50000000): + ptr = ((ptr + step) % i) + 1 + if ptr == 1: + print i