|  | 
| 1 | 1 | import tkinter | 
| 2 | 2 | 
 | 
| 3 |  | -'''		#list of possible win combinations in the form of button numbers | 
|  | 3 | + | 
|  | 4 | +class pvp_app(): | 
|  | 5 | + | 
|  | 6 | +    def __init__(self): | 
|  | 7 | +        tkinter.Frame.__init__(self) | 
|  | 8 | + | 
|  | 9 | +    ''' | 
|  | 10 | +    #list of possible win combinations in the form of button numbers | 
| 4 | 11 |         WinCombo=[[1,2,3], [4,5,6], [7,8,9],    #rows    | 
| 5 | 12 |                   [1,4,7], [2,5,8], [3,6,9],    #columns | 
| 6 | 13 |                   [1,5,9], [3,5,7]]             #diagonals | 
|  | 
| 33 | 40 |                     for k in range(1,10): | 
| 34 | 41 |                         self.button_lst[k].configure(state=DISABLED) | 
| 35 | 42 |                     break | 
| 36 |  | -''' | 
| 37 |  | - | 
| 38 |  | - | 
| 39 |  | -class pvp_app(): | 
| 40 |  | -    def __init__(self): | 
| 41 |  | -        tkinter.Frame.__init__(self) | 
|  | 43 | +    ''' | 
| 42 | 44 | 
 | 
| 43 | 45 |     def PlayerGame(self): | 
| 44 | 46 |         self.pvp_button.grid_forget() | 
| @@ -80,7 +82,8 @@ def PlayerGame(self): | 
| 80 | 82 |                                                        bg="red", | 
| 81 | 83 |                                                        state=tkinter.DISABLED, | 
| 82 | 84 |                                                        command=lambda x=i, | 
| 83 |  | -                                                                      y=j: self.handle_button( | 
|  | 85 | +                                                                      y=j: | 
|  | 86 | +                                                       self.handle_button( | 
| 84 | 87 |                                                            x, y), height=1, | 
| 85 | 88 |                                                        width=2, | 
| 86 | 89 |                                                        font=("Purisa", 18)) | 
| @@ -234,7 +237,8 @@ def check(self): | 
| 234 | 237 |                         break | 
| 235 | 238 |         if self.GameDone == tkinter.TRUE: | 
| 236 | 239 |             self.message = tkinter.messagebox.askquestion(" ", | 
| 237 |  | -                                                          "Do you want to play the " | 
|  | 240 | +                                                          "Do you want to " | 
|  | 241 | +                                                          "play the " | 
| 238 | 242 |                                                           "game again?") | 
| 239 | 243 |             if self.message == "no": | 
| 240 | 244 |                 self.QuitGame() | 
| @@ -304,7 +308,8 @@ def __init__(self, master=None): | 
| 304 | 308 | 
 | 
| 305 | 309 |     def ShowHomepage(self): | 
| 306 | 310 |         self.homepage_label = tkinter.Label(self, | 
| 307 |  | -                                            text="WELCOME TO THE WORLD OF TIC-TAC-TOE", | 
|  | 311 | +                                            text="WELCOME TO THE WORLD OF " | 
|  | 312 | +                                                 "TIC-TAC-TOE", | 
| 308 | 313 |                                             font=("courier", 15), fg="red", | 
| 309 | 314 |                                             bg="yellow") | 
| 310 | 315 |         self.homepage_label.grid(row=0, column=1, padx=20, pady=25) | 
|  | 
0 commit comments