From 84b6e12244e050421f54e60e1e82f018ff1a79d3 Mon Sep 17 00:00:00 2001 From: Maximilian Wagner Date: Mon, 19 Jun 2023 19:13:09 +0200 Subject: [PATCH] =?UTF-8?q?Game=20Over=20check=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logik.pl | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/logik.pl b/logik.pl index e694d0d..2efac5a 100644 --- a/logik.pl +++ b/logik.pl @@ -144,6 +144,16 @@ change_player :- !. +% Falls das Spiel vorbei ist, mach nix +end_turn :- + game_over, + write("Game Over!"), nl, + + inactive_player(Winner), + write("Player "), + write(Winner), + write(" wins!"). + % Beendet den Aktuellen Zug des Spielers end_turn :- % Die verbleibenden Tokens als Turn Speichern @@ -187,4 +197,10 @@ calc_tokens(Tokens) :- player_turn(Player, PreLastTurn, Tprelast), % Neue Anzahl der Tokens ausgeben - Tokens is Tadd - Tprelast. \ No newline at end of file + Tokens is Tadd - Tprelast. + + +% game_over ist true wenn das game over ist - surprise surprise +game_over :- + current_player(Player), + \+ einheit_active(Player,_,_,_,_). \ No newline at end of file