summaryrefslogtreecommitdiffstats
path: root/day15/__init__.py
diff options
context:
space:
mode:
authorGravatar Tom van der Lee <tom@vanderlee.io>2022-10-31 10:52:05 +0100
committerGravatar Tom van der Lee <tom@vanderlee.io>2022-10-31 10:52:05 +0100
commitcb247a773dfb1550621a5fa7cffb7473ac04aa99 (patch)
treef07c08e86ce52d1f5e6c7124edf3dbec31fbae21 /day15/__init__.py
parenta432fa698692c1e6bce0453f55a988b33385d75d (diff)
download2021-cb247a773dfb1550621a5fa7cffb7473ac04aa99.tar.gz
2021-cb247a773dfb1550621a5fa7cffb7473ac04aa99.tar.bz2
2021-cb247a773dfb1550621a5fa7cffb7473ac04aa99.zip
Added day 16HEADmaster
Diffstat (limited to 'day15/__init__.py')
-rw-r--r--day15/__init__.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/day15/__init__.py b/day15/__init__.py
index 38126fc..9eb94d9 100644
--- a/day15/__init__.py
+++ b/day15/__init__.py
@@ -116,17 +116,13 @@ class AssignmentOne(Assignment):
116 example_result = 40 116 example_result = 40
117 117
118class AssignmentTwo(Assignment): 118class AssignmentTwo(Assignment):
119 example_result = 315 119 example_result = 315
120
121 @classmethod
122 def overflow(self, item):
123 return item - 9 if item > 9 else item
124 120
125 @classmethod 121 @classmethod
126 def increase_map(cls, map) -> Map: 122 def increase_map(cls, map) -> Map:
127 return [ 123 return [
128 [ 124 [
129 cls.overflow(item + dx + dy) 125 ((item + dx + dy - 1) % 9) + 1
130 for dx in range(5) 126 for dx in range(5)
131 for item in row 127 for item in row
132 ] 128 ]