From e09b6d1737f4573244a7faec46ec09bbb1d009a4 Mon Sep 17 00:00:00 2001 From: Aineopintojen-harjoitustyo-Algoritmit-j Date: Fri, 12 Jan 2024 09:42:15 +0200 Subject: Trying to fix the 1x1 uncover bug. Adding instructions to readme. --- board/board.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'board') 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 -- cgit v1.2.3