summaryrefslogtreecommitdiff
path: root/app.py
diff options
context:
space:
mode:
authorAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-11 23:10:50 +0200
committerAineopintojen-harjoitustyo-Algoritmit-j <github-hy-tiralabra@v.hix.fi>2024-01-11 23:10:50 +0200
commitf523205db34d86292bcb9db386c3f956f557b904 (patch)
tree40981f856933098821eb92dc32fd94218c1bc7af /app.py
parent134a7d0960ceb2ab29d60f939a491d6a2d3461e5 (diff)
Hacking it up to be playable...
Diffstat (limited to 'app.py')
-rw-r--r--app.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/app.py b/app.py
new file mode 100644
index 0000000..4c0c325
--- /dev/null
+++ b/app.py
@@ -0,0 +1,20 @@
+from board.board import Board
+from tui.tui import Tui
+
+b = Board()
+t = Tui()
+x, y = 0, 0
+
+while True:
+ x, y = t.matrix_selector(b.get_view(), x, y)
+ if x == -1:
+ print("LOPETUS!")
+ break
+ if not b.make_guess(x, y):
+ print("KUOLEMA!")
+ break
+ if b.is_winning():
+ print("VOITTO!")
+ break
+
+t.draw_matrix(b.get_view(),-1,-1) \ No newline at end of file