@@ -47,12 +47,6 @@ def winning_move(board, piece):
47
47
if board [r ][c ]== piece and board [r + 1 ][c + 1 ]== piece and board [r + 2 ][c + 2 ]== piece and board [r + 3 ][c + 3 ]== piece :
48
48
return True
49
49
50
-
51
-
52
-
53
-
54
-
55
-
56
50
#CHECK NEGATIVE DIAGONALS
57
51
for c in range (COLUMN_COUNT - 3 ):
58
52
for r in range (3 ,ROW_COUNT ):
@@ -70,9 +64,6 @@ def draw_board(board):
70
64
if board [r ][c ]== 1 :
71
65
pygame .draw .circle (screen ,RED ,(int (c * SQUARESIZE + SQUARESIZE / 2 ),height - int (r * SQUARESIZE + SQUARESIZE / 2 )),RADIUS )
72
66
73
-
74
-
75
-
76
67
elif board [r ][c ]== 2 :
77
68
pygame .draw .circle (screen ,YELLOW ,(int (c * SQUARESIZE + SQUARESIZE / 2 ),height - int (r * SQUARESIZE + SQUARESIZE / 2 )),RADIUS )
78
69
@@ -120,24 +111,10 @@ def draw_board(board):
120
111
#print(event.pos)
121
112
pygame .draw .rect (screen ,BLACK ,(0 ,0 ,width ,SQUARESIZE ))
122
113
123
-
124
-
125
-
126
-
127
-
128
-
129
-
130
-
131
-
132
-
133
114
if turn == 0 :
134
115
posx = event .pos [0 ]
135
116
col = int (math .floor (posx / SQUARESIZE ))
136
117
137
-
138
-
139
-
140
-
141
118
if is_valid_location (board ,col ):
142
119
row = get_next_open_row (board ,col )
143
120
drop_piece (board ,row ,col ,1 )
@@ -149,20 +126,10 @@ def draw_board(board):
149
126
screen .blit (label ,(40 ,10 ))
150
127
game_over = True
151
128
152
-
153
-
154
-
155
-
156
-
157
129
else :
158
130
posx = event .pos [0 ]
159
131
col = int (math .floor (posx / SQUARESIZE ))
160
132
161
-
162
-
163
-
164
-
165
-
166
133
if is_valid_location (board ,col ):
167
134
row = get_next_open_row (board ,col )
168
135
drop_piece (board ,row ,col ,2 )
@@ -173,10 +140,6 @@ def draw_board(board):
173
140
screen .blit (label ,(40 ,10 ))
174
141
game_over = True
175
142
176
-
177
-
178
-
179
-
180
143
print_board (board )
181
144
draw_board (board )
182
145
0 commit comments