Skip to content

Commit

Permalink
Merge branch 'master' into cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
96hoshi authored Nov 1, 2020
2 parents 9e2e154 + f135f0c commit 19c818c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions game.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@
black_times = []


# set the board with the initial configuration
# starting board
def start_board(board):
for c in range(SIZE):
for r in range(3):
if c % 2 == 0 and r % 2 == 0:
board[r][c] = BLACK
elif c % 2 != 0 and r % 2 != 0:
board[r][c] = BLACK
board[r][c] = BLACK

for r in range(5, SIZE):
if c % 2 == 0 and r % 2 == 0:
board[r][c] = WHITE
elif c % 2 != 0 and r % 2 != 0:
board[r][c] = WHITE
board[r][c] = WHITE


def increment_draw(color):
Expand All @@ -52,13 +52,13 @@ def reset_draw(color):
# it occur when a player wins or 40 moves without a eat move is performed.
# if an eat move is performed then reset the counter, else increment it
def game_over(eat_move, color, end):
winner = "Whites"
if color == BLACK:
winner = "Blacks"

if end:
winner = "Whites"
if color == BLACK:
winner = "Blacks"
print(winner + " win!")
return True

if eat_move:
reset_draw(color)
else:
Expand Down

0 comments on commit 19c818c

Please sign in to comment.