you can kindaa drop. it drops wrong tho
This commit is contained in:
parent
36bfb7d407
commit
85de7ecd85
38
main.py
38
main.py
|
|
@ -12,10 +12,46 @@ def clear():
|
||||||
def findLowest(board, column):
|
def findLowest(board, column):
|
||||||
return board[column].index("O")
|
return board[column].index("O")
|
||||||
|
|
||||||
|
"""
|
||||||
|
This is how the board should output:
|
||||||
|
|
||||||
|
===============
|
||||||
|
|O|O|O|O|O|O|O|
|
||||||
|
|O|O|O|O|O|O|O|
|
||||||
|
|O|O|O|O|O|O|O|
|
||||||
|
|O|O|O|O|O|O|O|
|
||||||
|
|O|O|O|O|O|O|O|
|
||||||
|
|O|O|O|O|O|O|O|
|
||||||
|
===============
|
||||||
|
"""
|
||||||
|
|
||||||
|
def printBoard(board):
|
||||||
|
print("===============")
|
||||||
|
|
||||||
|
rows = []
|
||||||
|
|
||||||
|
for column in board:
|
||||||
|
row = ""
|
||||||
|
for i in range(len(column)):
|
||||||
|
index = board.index(column)
|
||||||
|
row += "|" + board[index][i]
|
||||||
|
rows.append(row+"\n")
|
||||||
|
|
||||||
|
rows = rows[::-1]
|
||||||
|
|
||||||
|
toPrint = ""
|
||||||
|
for row in rows:
|
||||||
|
toPrint += row
|
||||||
|
|
||||||
|
print(toPrint)
|
||||||
|
|
||||||
|
|
||||||
# Board will be 7x6.
|
# Board will be 7x6.
|
||||||
|
|
||||||
# O = open, R = red, Y = yellow
|
# O = open, R = red, Y = yellow
|
||||||
# because this is defined like this, you could technically save a game then load from where you left off
|
# because this is defined like this, you could technically save a game then load from where you left off
|
||||||
|
|
||||||
|
# This is defined as columns, not rows. So tile 0 on column 0 is the bottom left tile of the board
|
||||||
board = [
|
board = [
|
||||||
['O', 'O', 'O', 'O', 'O', 'O'],
|
['O', 'O', 'O', 'O', 'O', 'O'],
|
||||||
['O', 'O', 'O', 'O', 'O', 'O'],
|
['O', 'O', 'O', 'O', 'O', 'O'],
|
||||||
|
|
@ -45,7 +81,9 @@ while playing:
|
||||||
board[chosenColumn][tile] = turn
|
board[chosenColumn][tile] = turn
|
||||||
|
|
||||||
print(board)
|
print(board)
|
||||||
|
printBoard(board)
|
||||||
|
|
||||||
input()
|
input()
|
||||||
|
|
||||||
turn = 'Y' if turn == 'R' else 'R'
|
turn = 'Y' if turn == 'R' else 'R'
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user