def printBoard(a: gameLogic.gameState, count: int): """ Prints the current board with the row and column numbers. It uses unicode to print black dots for black and white one for white and '-' for blank spaces. Then it prints the score and whose turn it is. """ blackCount, whiteCount, rowNum, colNum = 0, 0, 1, 1 B = u" \u25CF " # Black dot W = u" \u25CB " # White dot print("=================================================") # Division between each board print print("\t Current Board:") print("=================================================") # Division between each board print topRow = "" print(" ", end=" ") for col in range(0, a.getCol()): # Prints the column numbers at the top of the board if col < 9: # To format spaces properly add 0 before all single digits. print("0{}".format(colNum), end=" ") colNum += 1 else: print("{} ".format(colNum), end="") # Prints two-digit column numbers. colNum += 1 print() for row in range(0, a.getRows()): # Runs through rows currentRow = "" for col in range(0, a.getCol()): # Runs through columns if a.getBoard()[col][row] == gameLogic.NONE: # Checks if space is empty and places '-' in it if true currentRow += " - " elif a.getBoard()[col][row] == gameLogic.BLACK: # Places black dot if piece is black currentRow += B blackCount += 1 elif a.getBoard()[col][row] == gameLogic.WHITE: # Places white dot if piece is white currentRow += W whiteCount += 1 if rowNum < 10: # Formats column numbers if less than 10 print("0{}".format(rowNum), end="") print(currentRow) rowNum += 1 else: # Formats colum numbers with two digits. print("{}".format(rowNum), end="") print(currentRow) rowNum += 1 print("BLACK: {}\tWHITE: {}".format(blackCount, whiteCount)) # Prints current score of black and white gameLogic.checkWin(a, a.getTurn(), count) # Checks if game has ended printTurn(a) # Prints whose turn it is.