diff options
author | Aineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi> | 2024-02-17 09:41:48 +0200 |
---|---|---|
committer | Aineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi> | 2024-02-17 09:41:48 +0200 |
commit | e785dbd4f726c5716f21071ed25dc35ac87c0c74 (patch) | |
tree | 781373b78380a1ffd1ea8c5dc8ceb2bd313631e9 /bots/simple.py | |
parent | 4eff4a32cfa594cc2a3df3885de92d407edc6675 (diff) |
Dev tools and directory structure rework.
Diffstat (limited to 'bots/simple.py')
-rw-r--r-- | bots/simple.py | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/bots/simple.py b/bots/simple.py deleted file mode 100644 index 54e2d05..0000000 --- a/bots/simple.py +++ /dev/null @@ -1,29 +0,0 @@ -""" bots/simple.py - yksinkertainen botti joka etsii vain yhdeltä laatalta """ -from random import sample -from .bot import Bot - -class SimpleBot(Bot): - """ SimpleBot - perustyhmä botti """ - - def search(self): - """ simple_search - jos viereisten avaamattomien määrä tästmää """ - tiles = self.get_interesting_tiles() - for tile in tiles: - c = self.get_value(tile) - n = self.get_neighbours(tile) - self.remove_number_tiles(n) - c -= self.remove_mine_tiles(n) - if c == 0: - for safe in n: - self.safe_tiles.add(safe) - if c == len(n): - for mine in n: - self.mine_tiles.add(mine) - return self.saved_hints() - - def lucky_guess(self): - tiles = self.get_unknown_tiles() - if tiles: - self.safe_tiles.add(sample(sorted(tiles),1)[0]) - return True - return False |