funktioniert fast. Spieler 2 gewinnt immer
This commit is contained in:
parent
59b1018ea4
commit
973c2efd59
18
GUI.py
18
GUI.py
@ -3,15 +3,29 @@ from tkinter import messagebox
|
|||||||
root = Tk()
|
root = Tk()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def ok():
|
def ok():
|
||||||
name = s1_wert.get()
|
s1 = s1_wert.get()
|
||||||
return messagebox.showinfo( f"", name)
|
s2 = s2_wert.get()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if s1 == "s" and s2 == "p" or s1 == "p" and s2 == "r" or s1 == "r" and s2 == "s":
|
||||||
|
print("Spieler 1 hat gewonnen")
|
||||||
|
print("Spieler 1 hat :" "Punkte")
|
||||||
|
|
||||||
|
else:
|
||||||
|
print("Spieler 2 hat gewonnen")
|
||||||
|
print("Spieler 2 hat", "Punkte")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Label(root, text="S = Schere, R = Stein, P = Papier ").pack()
|
Label(root, text="S = Schere, R = Stein, P = Papier ").pack()
|
||||||
|
|
||||||
s1_wert = Entry(root)
|
s1_wert = Entry(root)
|
||||||
s1_wert.pack()
|
s1_wert.pack()
|
||||||
|
s2_wert = Entry(root)
|
||||||
|
s2_wert.pack()
|
||||||
|
|
||||||
Button(root, text="Wählen", command=ok).pack()
|
Button(root, text="Wählen", command=ok).pack()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user