From 582a5b803c6904448e15fe658553ac556ccd52bd Mon Sep 17 00:00:00 2001 From: ssabur476 <68954445+ssabur476@users.noreply.github.com> Date: Sat, 24 Oct 2020 20:08:13 +0800 Subject: [PATCH] Update tic-tac-toe.py --- Python/Python_Games/tic-tac-toe.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Python/Python_Games/tic-tac-toe.py b/Python/Python_Games/tic-tac-toe.py index 5e45826..062edae 100644 --- a/Python/Python_Games/tic-tac-toe.py +++ b/Python/Python_Games/tic-tac-toe.py @@ -5,11 +5,16 @@ # In[5]: +print("---------------------------------------") +print("Welcome to tic tac toe") +print("---------------------------------------") +name1=input("Player 1 name:") +name2=input("Player 2 name:") from tkinter import * import tkinter.messagebox tk = Tk() -tk.title("Tic Tac Toe") +tk.title("Tic Tac Toe game") pa = StringVar() playerb = StringVar() @@ -54,7 +59,7 @@ def btnClick(bs): checkForWin() flag += 1 else: - tkinter.messagebox.showinfo("Tic-Tac-Toe", "Button already Clicked!") + tkinter.messagebox.showinfo("Tic-Tac-Toe", "Button has been already Clicked!") def checkForWin(): if (b1['text'] == 'X' and b2['text'] == 'X' and b3['text'] == 'X' or @@ -70,7 +75,7 @@ def checkForWin(): tkinter.messagebox.showinfo("Tic-Tac-Toe", pa) elif(flag == 8): - tkinter.messagebox.showinfo("Tic-Tac-Toe", "It is a Tie") + tkinter.messagebox.showinfo("Tic-Tac-Toe", "No winner, there is a tie") elif (b1['text'] == 'O' and b2['text'] == 'O' and b3['text'] == 'O' or b4['text'] == 'O' and b5['text'] == 'O' and b6['text'] == 'O' or