From 5bcef8336bb911463a89bb0bb7dbb1583340a5be Mon Sep 17 00:00:00 2001 From: = <=> Date: Tue, 6 Feb 2024 16:08:43 +0100 Subject: [PATCH] added generate_neighbors --- python/tuple_tools.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/python/tuple_tools.py b/python/tuple_tools.py index c099092..f56194e 100644 --- a/python/tuple_tools.py +++ b/python/tuple_tools.py @@ -1,4 +1,14 @@ +def generate_neighbors(a, b, c): + return [ + (a-1, b, c), + (a+1, b, c), + (a, b-1, c), + (a, b+1, c), + (a, b, c-1), + (a, b, c+1) + ] + def reorient_tuple(t, n): t, _ = _invert(*_flip(*_rotate(t, n))) return t