Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
Add documentation to the file
  • Loading branch information
ocryptocode authored Jun 27, 2024
1 parent 7888557 commit 77a9536
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions projects/Chess/main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# import necessary dependencies
from sys import exit
import pygame

# initialize the game
pygame.init()

# display game
surface = pygame.display.set_mode((640, 640))
pygame.display.set_caption("Chess")

Expand All @@ -23,6 +26,7 @@
turn = 1


# define ValidMoveGenerator class
class ValidMoveGenerator(object):
def __init__(self):
self.vMoves = []
Expand Down Expand Up @@ -282,6 +286,7 @@ def sameColor(self, x, y, grid):
validMoveGen = ValidMoveGenerator()


# define Board class
class Board(object):
def __init__(self):
self.sqs = [[], [], [], [], [], [], [], []]
Expand Down Expand Up @@ -559,6 +564,7 @@ def notResultsInCheck(x1, y1, x2, y2):
return True


# define Event object
class Event(object):
def __init__(self):
self.selected = False
Expand Down

0 comments on commit 77a9536

Please sign in to comment.