From 5d577470d8c5b0c3889781dc35980bd584f1ede2 Mon Sep 17 00:00:00 2001 From: RochoElLocho Date: Fri, 4 Aug 2023 11:09:23 +0200 Subject: [PATCH] =?UTF-8?q?unentschieden=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GUI.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/GUI.py b/GUI.py index 4878ec4..451daa2 100644 --- a/GUI.py +++ b/GUI.py @@ -7,7 +7,10 @@ root = Tk() def ok(): s1=s1_wert.get() s2=s2_wert.get() - if s1 == "s" and s2 == "p" or s1 == "p" and s2 == "r" or s1 == "r" and s2 == "s": + if s1 == s2: + messagebox.showinfo("unentschieden",f"Unentschieden") + + elif s1 == "s" and s2 == "p" or s1 == "p" and s2 == "r" or s1 == "r" and s2 == "s": messagebox.showinfo("Gewinner",f"Spieler 1 hat gewonnen") else: messagebox.showinfo("Gewinner",f"Spieler 2 hat gewonnen") @@ -16,14 +19,14 @@ def ok(): -Label(root, text="S = Schere, R = Stein, P = Papier ").pack() +Label(root, text="S = Schere, R = Stein, P = Papier ").grid() s1_wert = Entry(root) -s1_wert.pack() +s1_wert.grid() s2_wert = Entry(root) -s2_wert.pack() +s2_wert.grid() -Button(root, text="Wählen", command=ok).pack() +Button(root, text="Wählen", command=ok).grid()