summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-12 09:42:15 +0200
committerAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-12 09:42:15 +0200
commite09b6d1737f4573244a7faec46ec09bbb1d009a4 (patch)
treef8029cccb83f01c8de5a2f633c14ddedc7b5c509
parentb6c689abc6d5860671c45460a99b487eb6872e22 (diff)
Trying to fix the 1x1 uncover bug. Adding instructions to readme.
-rw-r--r--README.md4
-rw-r--r--board/board.py5
2 files changed, 6 insertions, 3 deletions
diff --git a/README.md b/README.md
index e39a415..71a6873 100644
--- a/README.md
+++ b/README.md
@@ -6,3 +6,7 @@ Miinaharava ratkaisijalla
## Dokumentit:
- [määrittelydokumentti](doc/m%C3%A4%C3%A4rittelydokumentti.pdf)
+## Ohjeet:
+`git clone https://github.com/Aineopintojen-harjoitustyo-Algoritmit-j/miinaharava`
+`cd miinaharava`
+`python3 app.py`
diff --git a/board/board.py b/board/board.py
index 3491c01..23dfa79 100644
--- a/board/board.py
+++ b/board/board.py
@@ -85,8 +85,9 @@ class Board():
print("Ruutu on jo avattu", file=stderr)
return False
+ self.masked[x][y] = 0
+
if self.tiles[x][y] == 9:
- self.masked[x][y] = 0
return False
if self.tiles[x][y] == 0:
@@ -94,8 +95,6 @@ class Board():
for dx, dy in ( (0,-1), (-1,0), (0,0), (1,0), (0,1) ):
if not self.invalid_coordinates(cx+dx, cy+dy):
self.masked[cx+dx][cy+dy] = 0
- else:
- self.masked[x][y] = 0
return True