diff options
| -rw-r--r-- | app.py | 2 | ||||
| -rw-r--r-- | board/board.py | 2 | ||||
| -rw-r--r-- | tui/tui.py | 4 | 
3 files changed, 5 insertions, 3 deletions
| @@ -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): @@ -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)          ) |