Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Commit 56f680e

Browse files
Merge pull request #771 from ocryptocode/patch-3
Update main.py
2 parents 28791d2 + 77a9536 commit 56f680e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

projects/Chess/main.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
# import necessary dependencies
12
from sys import exit
23
import pygame
34

5+
# initialize the game
46
pygame.init()
57

8+
# display game
69
surface = pygame.display.set_mode((640, 640))
710
pygame.display.set_caption("Chess")
811

@@ -23,6 +26,7 @@
2326
turn = 1
2427

2528

29+
# define ValidMoveGenerator class
2630
class ValidMoveGenerator(object):
2731
def __init__(self):
2832
self.vMoves = []
@@ -282,6 +286,7 @@ def sameColor(self, x, y, grid):
282286
validMoveGen = ValidMoveGenerator()
283287

284288

289+
# define Board class
285290
class Board(object):
286291
def __init__(self):
287292
self.sqs = [[], [], [], [], [], [], [], []]
@@ -559,6 +564,7 @@ def notResultsInCheck(x1, y1, x2, y2):
559564
return True
560565

561566

567+
# define Event object
562568
class Event(object):
563569
def __init__(self):
564570
self.selected = False

0 commit comments

Comments
 (0)