From 88297d0b9bd2db784ab17246e6c70528024698c5 Mon Sep 17 00:00:00 2001 From: Angelika Iskra Date: Mon, 11 Apr 2022 12:08:03 +0200 Subject: [PATCH] added collision to bfs; --- algorithms/bfs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/algorithms/bfs.py b/algorithms/bfs.py index 94b150f..2e76d45 100644 --- a/algorithms/bfs.py +++ b/algorithms/bfs.py @@ -121,7 +121,7 @@ def go(row, column, direction): def is_valid_move(map, target_row, target_column): - if 0 <= target_row < ROWS and 0 <= target_column < COLUMNS: + if 0 <= target_row < ROWS and 0 <= target_column < COLUMNS and map[target_row][target_column] == ' ': return True return False