From 3ca5ab7806b36393244bf42edabf42f4e28fecfa Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Mon, 21 Dec 2020 23:19:49 +0100 Subject: Fix intentional use of negative indexing Signed-off-by: Olivier Gayot --- cameltris.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cameltris.py') diff --git a/cameltris.py b/cameltris.py index b0c78e1..60f8aee 100755 --- a/cameltris.py +++ b/cameltris.py @@ -109,6 +109,9 @@ def has_collision(y: int, x: int) -> bool: if element is None: continue + if row_id + y < 0: + continue + if col_id + x < 0: return True -- cgit v1.2.3