Skip to content

Commit fbb999d

Browse files
committed
Update Connect-Four.py
1 parent bfa88ff commit fbb999d

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

Connect-Four.py

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
import numpy as np
22
import pygame, sys, math
33

4-
BLUE = (0,0,255)
5-
BLACK = (0,0,0)
6-
RED = (255,0,0)
7-
YELLOW = (255,255,0)
4+
BLUE,BLACK,RED,YELLOW=(0,0,255),(0,0,0),(255,0,0),(255,255,0)
85

9-
ROW_COUNT = 6
10-
COLUMN_COUNT = 7
6+
ROW_COUNT,COLUMN_COUNT=6,7
117

128
def create_board():
139
board = np.zeros((ROW_COUNT,COLUMN_COUNT))
@@ -66,17 +62,14 @@ def draw_board(board):
6662
pygame.display.update()
6763

6864

69-
board = create_board()
65+
board,game_over,turn=create_board(),False,0
7066
print_board(board)
71-
game_over = False
72-
turn = 0
7367

7468
pygame.init()
7569

7670
SQUARESIZE = 100
7771

78-
width = COLUMN_COUNT * SQUARESIZE
79-
height = (ROW_COUNT+1) * SQUARESIZE
72+
width,height= COLUMN_COUNT * SQUARESIZE,(ROW_COUNT+1) * SQUARESIZE
8073

8174
size = (width, height)
8275

@@ -86,7 +79,7 @@ def draw_board(board):
8679
draw_board(board)
8780
pygame.display.update()
8881

89-
myfont = pygame.font.SysFont("monospace", 75)
82+
myfont = pygame.font.SysFont("commodore 64 pixelized", 58)
9083

9184
while not game_over:
9285
for event in pygame.event.get():

0 commit comments

Comments
 (0)