advent-of-code

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

commit 0df41a85d0559a57a0597d71ab2cb83962500989
parent c88f9ea338dae81d3e1bb2738d2f97aefe651853
Author: mpizzzle <michael.770211@gmail.com>
Date:   Fri,  8 Dec 2017 11:20:01 +0000

puzzle 5 complete

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

diff --git a/puzzle5.py b/puzzle5.py @@ -5,6 +5,7 @@ with open('files/puzzle5.txt') as f: pointer = 0 step_counter = 0 +instructions2 = list(instructions) while pointer < len(instructions): temp = pointer @@ -12,4 +13,18 @@ while pointer < len(instructions): instructions[temp] += 1 step_counter += 1 +print step_counter + +pointer = 0 +step_counter = 0 + +while pointer < len(instructions2): + temp = pointer + pointer += instructions2[pointer] + if instructions2[temp] >= 3: + instructions2[temp] -= 1 + else: + instructions2[temp] += 1 + step_counter += 1 + print step_counter \ No newline at end of file