Skip to content

Commit

Permalink
Ensure integer division
Browse files Browse the repository at this point in the history
  • Loading branch information
mlouhivu committed Apr 7, 2022
1 parent 006c9a7 commit 60bc9f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions numpy/game-of-life/solution/game-of-life.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def initialize(size, shape='cross'):
board = np.random.rand(size, size).round(0).astype(int)
elif shape == 'cross':
board = np.zeros((size, size), int)
board[size/2,:] = 1
board[:,size/2] = 1
board[size//2,:] = 1
board[:,size//2] = 1
else:
raise NotImplementedError('Unknown initial shape')

Expand Down

0 comments on commit 60bc9f2

Please sign in to comment.