advent-of-code

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 77fd00b8a91b0d7da2a81456cea353431087a4ac
parent fb9640846af2e557d9ae6c315d15b29790b4ca5e
Author: mpizzzle <michael.770211@gmail.com>
Date:   Sun, 17 Dec 2017 21:17:12 +0000

puzzle 17 part 1 complete

Diffstat:
Apuzzle17.py | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/puzzle17.py b/puzzle17.py @@ -0,0 +1,10 @@ +spinlock_buffer = [0] + +ptr = 0 +step = 329 + +for i in range(1, 2018): + ptr = ((ptr + step) % len(spinlock_buffer)) + 1 + spinlock_buffer.insert(ptr, i) + +print spinlock_buffer[ptr + 1]