public int playGame(int players, gameBoard board, bool Louie) { bool gameOver = false; int result = 0; if (moveCount == 0) { board.initBoard(board); } //while(!gameOver) { playerTakeTurn(1, board); if (players != 1) { playerTakeTurn(2, board); } else { pcTakeTurn(); } int check = checkGameStatus(board); result = check; moveCount++; } return(result); }
public int playGame(int players, gameBoard board, bool Louie) { bool gameOver = false; int result = 0; board.initBoard(board); //while(!gameOver) { playerTakeTurn(1); checkForCat(); if (players != 1) { playerTakeTurn(2); } else { pcTakeTurn(); } int check = checkGameStatus(board); result = check; } return(result); }
public bool isSpotEmpty(int row, int col, gameBoard board) { bool result = false; if (board.gameBoardObj[row, col].Equals("*")) { ; } result = true; return(result); }
public int checkGameStatus(gameBoard board) { int result = 0; for (int i = 0; i < board.getSize(); i++) { if ((board.getGameBoard())[0, i] == "3") { result = 1; } } return(result); }
public void playerTakeTurn(int player, gameBoard board) { if (player == 1) { playerToken = "X"; } else { playerToken = "O"; } board.placeMove(comboBoxRow.SelectedIndex + 1, comboBoxColumn.SelectedIndex + 1, board, playerToken); }
public void initBoard(gameBoard board) { for (int i = 1; i < board.boardSize; i++) { for (int j = 1; j < board.boardSize; j++) { board.gameBoardObj[i, j] = "*"; } } for (int i = 0; i < board.boardSize; i++) { board.gameBoardObj[0, i] = "0"; board.gameBoardObj[i, 0] = "0"; } }
public int checkRow(gameBoard board, int row, int col) { int rowResult = 0; for (int i = 1; i < board.getSize(); i++) { if (board.gameBoardObj[i, col] == "X") { rowResult++; } else if (board.gameBoardObj[i, col] == "O") { rowResult--; } } return(rowResult); }
private void readBoard(gameBoard board) { board.getGameBoard() }
public void updateBoard(int col, int row, gameBoard board) { board.placeMove(row, col, board, playerToken); board.checkColumn(board, row, col); board.checkRow(board, row, col); }
public void placeMove(int row, int col, gameBoard board, String playerToken) { board.gameBoardObj[row, col] = playerToken; }