Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 12ce7b5

Browse files
Update Connect-4.py
Removed the the unwanted spaces.
1 parent 1ad5fc0 commit 12ce7b5

File tree

1 file changed

+0
-37
lines changed

1 file changed

+0
-37
lines changed

‎Connect-4 game/Connect-4.py

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ def winning_move(board, piece):
4747
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:
4848
return True
4949

50-
51-
52-
53-
54-
55-
5650
#CHECK NEGATIVE DIAGONALS
5751
for c in range(COLUMN_COUNT-3):
5852
for r in range(3,ROW_COUNT):
@@ -70,9 +64,6 @@ def draw_board(board):
7064
if board[r][c]==1:
7165
pygame.draw.circle(screen,RED,(int(c*SQUARESIZE+SQUARESIZE/2),height-int(r*SQUARESIZE+SQUARESIZE/2)),RADIUS)
7266

73-
74-
75-
7667
elif board[r][c]==2:
7768
pygame.draw.circle(screen,YELLOW,(int(c*SQUARESIZE+SQUARESIZE/2),height-int(r*SQUARESIZE+SQUARESIZE/2)),RADIUS)
7869

@@ -120,24 +111,10 @@ def draw_board(board):
120111
#print(event.pos)
121112
pygame.draw.rect(screen,BLACK,(0,0,width,SQUARESIZE))
122113

123-
124-
125-
126-
127-
128-
129-
130-
131-
132-
133114
if turn==0:
134115
posx=event.pos[0]
135116
col=int(math.floor(posx/SQUARESIZE))
136117

137-
138-
139-
140-
141118
if is_valid_location(board,col):
142119
row=get_next_open_row(board,col)
143120
drop_piece(board,row,col,1)
@@ -149,20 +126,10 @@ def draw_board(board):
149126
screen.blit(label,(40,10))
150127
game_over=True
151128

152-
153-
154-
155-
156-
157129
else:
158130
posx=event.pos[0]
159131
col=int(math.floor(posx/SQUARESIZE))
160132

161-
162-
163-
164-
165-
166133
if is_valid_location(board,col):
167134
row=get_next_open_row(board,col)
168135
drop_piece(board,row,col,2)
@@ -173,10 +140,6 @@ def draw_board(board):
173140
screen.blit(label,(40,10))
174141
game_over=True
175142

176-
177-
178-
179-
180143
print_board(board)
181144
draw_board(board)
182145

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /