From c21b29f12f4abeb90fed3b99f8ed3be16f8b79e7 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 16 Dec 2021 12:10:15 +0100 Subject: Make even more use of lambdas --- 2021/16/puzzles.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '2021') 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 -- cgit v1.2.3