Skip to content

Commit af0b1d2

Browse files
authored
Update Chain-Reaction.py
1 parent 89bb90e commit af0b1d2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Chain_Reaction/Chain-Reaction.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
font = pygame.font.SysFont("Times New Roman", 30)
4141

4242
blocks = 40
43-
noPlayers = 2
43+
noPlayers = 4
4444

4545
pygame.display.set_caption("Chain Reaction %d Player" % noPlayers)
4646

@@ -52,10 +52,10 @@
5252
for i in range(noPlayers):
5353
players.append(playerColor[i])
5454

55-
d = blocks/2 - 2
55+
d = blocks//2 - 2
5656

57-
cols = int(width/blocks)
58-
rows = int(height/blocks)
57+
cols = int(width//blocks)
58+
rows = int(height//blocks)
5959

6060
grid = []
6161

@@ -105,7 +105,7 @@ def initializeGrid():
105105
def drawGrid(currentIndex):
106106
r = 0
107107
c = 0
108-
for i in range(width/blocks):
108+
for i in range(width//blocks):
109109
r += blocks
110110
c += blocks
111111
pygame.draw.line(display, players[currentIndex], (c, 0), (c, height))

0 commit comments

Comments
 (0)