uses checkwin stub. slightly less yucky loops
This commit is contained in:
parent
7b2936ed02
commit
2c9fdaee10
9
main.py
9
main.py
|
|
@ -75,8 +75,7 @@ while playing:
|
||||||
clear()
|
clear()
|
||||||
printBoard(board)
|
printBoard(board)
|
||||||
|
|
||||||
tile = ""
|
while True:
|
||||||
while tile == "":
|
|
||||||
try:
|
try:
|
||||||
chosenColumn = getIntInput(f"{colourTile(player)} where do you want to drop your tile? 0-6.\n>>> ")
|
chosenColumn = getIntInput(f"{colourTile(player)} where do you want to drop your tile? 0-6.\n>>> ")
|
||||||
tile = board[chosenColumn].index("O")
|
tile = board[chosenColumn].index("O")
|
||||||
|
|
@ -94,6 +93,12 @@ while playing:
|
||||||
|
|
||||||
board[chosenColumn][tile] = player
|
board[chosenColumn][tile] = player
|
||||||
|
|
||||||
|
if checkWin(board):
|
||||||
|
clear()
|
||||||
|
printBoard()
|
||||||
|
print(f"{colourTile(player)} won!")
|
||||||
|
break
|
||||||
|
|
||||||
if player == 'R':
|
if player == 'R':
|
||||||
player = 'Y'
|
player = 'Y'
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user