aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <thomasvoss@live.com> 2021-12-16 12:10:15 +0100
committerThomas Voss <thomasvoss@live.com> 2021-12-16 12:10:15 +0100
commitc21b29f12f4abeb90fed3b99f8ed3be16f8b79e7 (patch)
tree4a8ff19ac6d9ce5d9e5b583e43b560ce8a84fb6e
parent8fd28be759da93efc80abd230fb33a045ed366c9 (diff)
Make even more use of lambdas
-rw-r--r--2021/16/puzzles.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/2021/16/puzzles.py b/2021/16/puzzles.py
index 75e29d1..7d47814 100644
--- a/2021/16/puzzles.py
+++ b/2021/16/puzzles.py
@@ -34,11 +34,11 @@ class Packet(NamedTuple):
case 4:
return self.value
case 5:
- return self.subpackets[0].calculate() > self.subpackets[1].calculate()
+ return f(self.subpackets[0]) > f(self.subpackets[1])
case 6:
- return self.subpackets[0].calculate() < self.subpackets[1].calculate()
+ return f(self.subpackets[0]) < f(self.subpackets[1])
case 7:
- return self.subpackets[0].calculate() == self.subpackets[1].calculate()
+ return f(self.subpackets[0]) == f(self.subpackets[1])
# END PART 2