34 lines
687 B
Python
34 lines
687 B
Python
from tkinter import *
|
|
from tkinter import messagebox
|
|
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":
|
|
return messagebox.showinfo("Gewinner",f"Spieler 1 hat gewonnen")
|
|
|
|
|
|
else:
|
|
return messagebox.showinfo("Gewinner",f"Spieler 2 hat gewonnen")
|
|
|
|
|
|
|
|
|
|
Label(root, text="S = Schere, R = Stein, P = Papier ").pack()
|
|
|
|
s1_wert = Entry(root)
|
|
s1_wert.pack()
|
|
s2_wert = Entry(root)
|
|
s2_wert.pack()
|
|
|
|
Button(root, text="Wählen", command=ok).pack()
|
|
|
|
|
|
root.mainloop()
|