summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app.py2
-rw-r--r--board/board.py2
-rw-r--r--tui/tui.py4
3 files changed, 5 insertions, 3 deletions
diff --git a/app.py b/app.py
index e3c6dd4..bf2a159 100644
--- a/app.py
+++ b/app.py
@@ -14,7 +14,7 @@ while True:
t.draw_matrix(b.get_view(),-1,-1)
print("LOPETUS!")
break
- if not b.make_guess(x, y):
+ if b.get_mask(x,y) and not b.make_guess(x, y):
t.draw_matrix(b.get_view(),-1,-1)
print("KUOLEMA!")
break
diff --git a/board/board.py b/board/board.py
index 9666bad..3491c01 100644
--- a/board/board.py
+++ b/board/board.py
@@ -73,6 +73,8 @@ class Board():
area=area.union(self.collect_area(tx, ty, area))
return area
+ def get_mask(self, x, y):
+ return self.masked[x][y]
def make_guess(self, x, y):
if self.invalid_coordinates(x, y):
diff --git a/tui/tui.py b/tui/tui.py
index ed997a4..2081711 100644
--- a/tui/tui.py
+++ b/tui/tui.py
@@ -39,8 +39,8 @@ class Tui():
def draw_tile(self, tile, hilighted):
chars_and_colors = (
- (' ', 7, 0), ('1', 10, 0), ('2', 12, 0),
- ('3', 11, 0), ('4', 9, 0), ('5', 9, 0),
+ (' ', 7, 0), ('1', 10, 0), ('2', 11, 0),
+ ('3', 13, 0), ('4', 9, 0), ('5', 9, 0),
('6', 9, 0), ('7', 9, 0), ('8', 9, 0),
('¤', 15, 1), ('#', 8, 7)
)