summaryrefslogtreecommitdiff
path: root/app.py
diff options
context:
space:
mode:
authorAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-11 23:30:10 +0200
committerAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-11 23:30:10 +0200
commit4ec901620ea94e8e89710576b4fc6ad1cf4b01e8 (patch)
tree434e89cc84bfa6aa2ac71978186d7a0c40ce8a0c /app.py
parentf523205db34d86292bcb9db386c3f956f557b904 (diff)
Making UI roll upp and down so that playing area stays.
Diffstat (limited to 'app.py')
-rw-r--r--app.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/app.py b/app.py
index 4c0c325..e3c6dd4 100644
--- a/app.py
+++ b/app.py
@@ -5,16 +5,21 @@ b = Board()
t = Tui()
x, y = 0, 0
+for _ in range(b.size):
+ print()
+
while True:
x, y = t.matrix_selector(b.get_view(), x, y)
if x == -1:
+ t.draw_matrix(b.get_view(),-1,-1)
print("LOPETUS!")
break
if not b.make_guess(x, y):
+ t.draw_matrix(b.get_view(),-1,-1)
print("KUOLEMA!")
break
if b.is_winning():
+ t.draw_matrix(b.get_view(),-1,-1)
print("VOITTO!")
break
-
-t.draw_matrix(b.get_view(),-1,-1) \ No newline at end of file
+