From eda6f114002adc9b9ae14df48494b3f739400973 Mon Sep 17 00:00:00 2001 From: RochoElLocho Date: Tue, 8 Aug 2023 11:02:49 +0200 Subject: [PATCH] =?UTF-8?q?Punkte=20vergabe=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tic Tac Toe.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Tic Tac Toe.py b/Tic Tac Toe.py index 397ce10..8bc815b 100644 --- a/Tic Tac Toe.py +++ b/Tic Tac Toe.py @@ -1,6 +1,8 @@ from tkinter import * root = Tk() root.geometry("900x500") +punkte = 0 +punkte1 = 0 f1 = StringVar(value="1") f2 = StringVar(value="2") @@ -36,12 +38,18 @@ def result(): if f1.get()==f2.get()==f3.get() == "O" or f1.get()==f5.get()==f9.get() == "O" or f1.get()==f4.get()==f7.get() == "O" or f4.get()==f5.get()==f6.get() == "O" or f7.get()==f8.get()==f9.get() == "O" or f2.get()==f5.get()==f8.get()== "O" or f3.get()==f6.get()==f9.get() == "O": Label(root, text="Spieler 1 Gewinnt").grid(row=8, column=2) Button(root, text="Neue Runde", command=reset).grid(row=9, column=2) - + global punkte + punkte += 1 + Label(root, text="Punkte:" ).grid(row=10, column=0) + Label(root, text=punkte).grid(row=11,column=0) def result1(): if f1.get()==f2.get()==f3.get() == "X" or f1.get()==f5.get()==f9.get() == "X" or f1.get()==f4.get()==f7.get() == "X" or f4.get()==f5.get()==f6.get() == "X" or f7.get()==f8.get()==f9.get() == "X" or f2.get()==f5.get()==f8.get()== "X" or f3.get()==f6.get()==f9.get() == "X": Label(root, text="Spieler 2 Gewinnt").grid(row=8, column=2) Button(root, text="Neue Runde", command=reset).grid(row=9, column=2) - + global punkte1 + punkte1 += 1 + Label(root, text="Punkte:" ).grid(row=10, column=7) + Label(root, text=punkte).grid(row=11,column=7) def ok(): zug=zug_wert.get()