Punkte vergabe hinzugefügt
This commit is contained in:
parent
c9692ed7bb
commit
32c5c79866
18
GUI.py
18
GUI.py
@ -3,18 +3,30 @@ from tkinter import messagebox
|
|||||||
root = Tk()
|
root = Tk()
|
||||||
root.geometry("850x300")
|
root.geometry("850x300")
|
||||||
|
|
||||||
|
punkte1 = 0
|
||||||
|
punkte2 = 0
|
||||||
|
|
||||||
def ok():
|
def ok():
|
||||||
|
|
||||||
s1=s1_wert.get()
|
s1=s1_wert.get()
|
||||||
s2=s2_wert.get()
|
s2=s2_wert.get()
|
||||||
|
|
||||||
|
|
||||||
if s1 == s2:
|
if s1 == s2:
|
||||||
messagebox.showinfo("unentschieden",f"Unentschieden")
|
messagebox.showinfo("unentschieden",f"Unentschieden")
|
||||||
|
|
||||||
elif s1 == "s" and s2 == "p" or s1 == "p" and s2 == "r" or s1 == "r" and s2 == "s":
|
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")
|
global punkte1
|
||||||
|
punkte1 += 1
|
||||||
|
messagebox.showinfo("Gewinner",f"Spieler 1 hat gewonnen und hat: {punkte1} Punkte")
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
messagebox.showinfo("Gewinner",f"Spieler 2 hat gewonnen")
|
global punkte2
|
||||||
|
punkte2 += 1
|
||||||
|
messagebox.showinfo("Gewinner",f"Spieler 2 hat gewonnenund hat: {punkte2} Punkte")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user