Created
December 8, 2020 05:54
-
-
Save felix-larsen/75abe53999725e704aaaaaab9a9bb757 to your computer and use it in GitHub Desktop.
8th December solution - Advent of Code - swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print(runInstructions(lines: lines)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var reachedEnd = false | |
var changeIndex = 0 | |
var accumulator = 0 | |
while !reachedEnd { | |
(accumulator, reachedEnd) = runInstructions(lines: lines, changeIndex: changeIndex) | |
changeIndex += 1 | |
} | |
print(accumulator) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment