mirror of
https://github.com/ershisan99/advent-of-code.git
synced 2025-12-16 04:59:34 +00:00
2015 day 6 refactored a bit
This commit is contained in:
@@ -21,10 +21,7 @@ for line in lines:
|
||||
if instruction == "turn on":
|
||||
lights[(i, j)] += 1
|
||||
elif instruction == "turn off":
|
||||
if lights[(i, j)] == 0:
|
||||
continue
|
||||
else:
|
||||
lights[(i, j)] -= 1
|
||||
lights[(i, j)] = max(0, lights[(i, j)] - 1)
|
||||
else:
|
||||
lights[(i, j)] += 2
|
||||
|
||||
|
||||
Reference in New Issue
Block a user