From 2862e73e1911c87a01ad723edeacc114e95ffdd8 Mon Sep 17 00:00:00 2001 From: Stefan Rupp Date: Sun, 12 Apr 2020 15:27:05 +0200 Subject: [PATCH] implementing game logic --- server.py | 12 +++- templates/home/player.html | 9 ++- templates/shared/_layout.html | 2 +- views/control.py | 2 +- views/player.py | 14 +++-- wiz_game.py | 106 +++++++++++++++++++++++++--------- 6 files changed, 106 insertions(+), 39 deletions(-) diff --git a/server.py b/server.py index 1549830..84bcb63 100755 --- a/server.py +++ b/server.py @@ -12,12 +12,18 @@ def main(): random.seed() - wiz_game.the_game.create_deck() + #wiz_game.the_game.create_deck() + #wiz_game.the_game.add_player("p1", 1) + #wiz_game.the_game.add_player("p2", 2) + #wiz_game.the_game.add_player("p3", 3) + #wiz_game.the_game.add_player("p4", 4) + #wiz_game.the_game.deal_cards(12) wiz_game.the_game.add_player("p1", 1) wiz_game.the_game.add_player("p2", 2) wiz_game.the_game.add_player("p3", 3) - #wiz_game.the_game.add_player("p4", 4) - wiz_game.the_game.deal_cards(12) + wiz_game.the_game.add_player("p4", 4) + wiz_game.the_game.init_game() + api.run(port=19203, address="127.0.0.1") exit(0) diff --git a/templates/home/player.html b/templates/home/player.html index ce81961..73acbc2 100644 --- a/templates/home/player.html +++ b/templates/home/player.html @@ -9,7 +9,10 @@
Player {{player}} view
Table
- {{played_cards}} + {% for key,value in played_cards.items() %} + || {{key.name}}: {{value}} + {% endfor %} + ||
Your cards: