summaryrefslogtreecommitdiff
path: root/cameltris.py
diff options
context:
space:
mode:
authorOlivier Gayot <olivier.gayot@sigexec.com>2020-12-21 23:19:49 +0100
committerOlivier Gayot <olivier.gayot@sigexec.com>2020-12-21 23:20:02 +0100
commit3ca5ab7806b36393244bf42edabf42f4e28fecfa (patch)
tree688cf60e3234508d4877a2019a3a24db2c82c797 /cameltris.py
parent7731757991d9a09053403ba2a529448a196cabfe (diff)
Fix intentional use of negative indexing
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
Diffstat (limited to 'cameltris.py')
-rwxr-xr-xcameltris.py3
1 files changed, 3 insertions, 0 deletions
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