summaryrefslogtreecommitdiff
path: root/src/miinaharava/bots/bot.py
diff options
context:
space:
mode:
authorAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-02-18 14:19:02 +0200
committerAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-02-18 14:19:02 +0200
commit890fd029b3ee1dee4a0c1c2430b061cd66b8b8e8 (patch)
treec1ee5d0e6a9888b34ecf6a45a0290b29a3769885 /src/miinaharava/bots/bot.py
parenta947010229c81872a28552bddc37a4761c3a575a (diff)
Refactor & comment bots.
Diffstat (limited to 'src/miinaharava/bots/bot.py')
-rw-r--r--src/miinaharava/bots/bot.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/miinaharava/bots/bot.py b/src/miinaharava/bots/bot.py
index cfeedce..b00f9a6 100644
--- a/src/miinaharava/bots/bot.py
+++ b/src/miinaharava/bots/bot.py
@@ -91,8 +91,12 @@ class Bot():
count+=1
return count
+ def are_neighbours(self, tile1, tile2):
+ """ Kertoo ovatko laatat naapureita keskenään """
+ return abs(tile1[0]-tile2[0])==1 or abs(tile1[1]-tile2[1])==1
+
def known_tile(self, tile):
- """ Kortoo onko laatta merkitty tai avattu. """
+ """ Kertoo onko laatta merkitty tai avattu. """
return self.matrix[tile[0]][tile[1]] < Tile.UNOPENED
def number_tile(self, tile):