From 32dd610fa04f543d863e55c3147e0d7541ee1fa2 Mon Sep 17 00:00:00 2001 From: RochoElLocho Date: Fri, 4 Aug 2023 10:54:43 +0200 Subject: [PATCH] funktioniert --- GUI.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/GUI.py b/GUI.py index db64346..4878ec4 100644 --- a/GUI.py +++ b/GUI.py @@ -5,17 +5,13 @@ root = Tk() def ok(): - s1 = s1_wert.get() - s2 = s2_wert.get() - - + 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": + messagebox.showinfo("Gewinner",f"Spieler 1 hat gewonnen") + else: + messagebox.showinfo("Gewinner",f"Spieler 2 hat gewonnen") - if s1 == "s" and s2 == "p" or s1 == "p" and s2 == "r" or s1 == "r" and s2 == "s": - return messagebox.showinfo("Gewinner",f"Spieler 1 hat gewonnen") - - - else: - return messagebox.showinfo("Gewinner",f"Spieler 2 hat gewonnen") @@ -29,5 +25,7 @@ s2_wert.pack() Button(root, text="Wählen", command=ok).pack() + + root.mainloop()