diff --git a/tic-tac-toe-gui-in-python-using-pygame b/tic-tac-toe-gui-in-python-using-pygame new file mode 100644 index 00000000..9064c394 --- /dev/null +++ b/tic-tac-toe-gui-in-python-using-pygame @@ -0,0 +1,36 @@ +# importing the required libraries +import pygame as pg +import sys +import time +from pygame.locals import * + +# declaring the global variables + +# for storing the 'x' or 'o' +# value as character +XO = 'x' + +# storing the winner's value at +# any instant of code +winner = None + +# to check if the game is a draw +draw = None + +# to set width of the game window +width = 400 + +# to set height of the game window +height = 400 + +# to set background color of the +# game window +white = (255, 255, 255) + +# color of the straightlines on that +# white game board, dividing board +# into 9 parts +line_color = (0, 0, 0) + +# setting up a 3 * 3 board in canvas +board = [[None]*3, [None]*3, [None]*3]