summaryrefslogtreecommitdiff
path: root/bots/bot.py
diff options
context:
space:
mode:
authorAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-29 03:40:19 +0200
committerAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-29 03:40:19 +0200
commit2b2117ec7bf75ad5ba37cc5b21870d073cb405a4 (patch)
treef8493d8b8da726e99f4a819ea7963b94b305dfb5 /bots/bot.py
parente591d15abc4943a74c39f0fcab065213828a1514 (diff)
Fixing guessing to use all bordering number tiles.
Diffstat (limited to 'bots/bot.py')
-rw-r--r--bots/bot.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/bots/bot.py b/bots/bot.py
index 49bd962..f32b466 100644
--- a/bots/bot.py
+++ b/bots/bot.py
@@ -123,6 +123,17 @@ class Bot():
tiles.add((x,y))
return tiles
+ def get_border_tiles(self):
+ """ palauttaa palauttaa numerolaatat joiden vieressä avaamaton """
+ tiles = set()
+ for x in range(self.w):
+ for y in range(self.h):
+ if self.number_tile((x,y)):
+ n = self.get_neighbours((x,y))
+ if self.count_unknowns(n):
+ tiles.add((x,y))
+ return tiles
+
def get_unknown_tiles(self):
""" palauttaa kaikki tuntemattomat laatat """
tiles = set()