35 lines
785 B
Python
35 lines
785 B
Python
from tkinter import *
|
|
from tkinter import messagebox
|
|
root = Tk()
|
|
root.geometry("850x300")
|
|
|
|
|
|
def ok():
|
|
s1=s1_wert.get()
|
|
s2=s2_wert.get()
|
|
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")
|
|
|
|
|
|
|
|
|
|
|
|
Label(root, text="S = Schere, R = Stein, P = Papier ", font=("times",25)).grid(column=1)
|
|
|
|
s1_wert = Entry(root,font=(28))
|
|
s1_wert.grid(row=1)
|
|
s2_wert = Entry(root,font=(28))
|
|
s2_wert.grid(row=1,column=2)
|
|
|
|
Button(root, text="Wählen", command=ok, font=(30)).grid(row=2, column=1)
|
|
|
|
|
|
|
|
|
|
root.mainloop()
|