private bool playerAIMove(int x, int y) { // me move gameController.PlayerMove(y, x); this.txtGameLog.AppendText(_gameBoard.Step + "> Black moved at (" + x + ", " + y + ");\r\n"); this._gameBoard.MovePiece(x, y); this.timer.Stop(); // judge winner int winner = gameController.GetWinner(); if (winner != 0) { _gameBoard.Lock(); if (winner == 1) { // black wins this.lblTurn.Text = "Black Won"; } else { // white wins this.lblTurn.Text = "White Won"; } return(false); } this.lblTurn.ForeColor = Color.Red; this.lblTurn.Text = "Machine's Turn"; // ai move GameController.Point aiMove = gameController.AIMove(); this.txtGameLog.AppendText(_gameBoard.Step + "> White moved at (" + aiMove.x + ", " + aiMove.y + ");\r\n"); this._gameBoard.MovePiece(aiMove.y, aiMove.x); _gameBoard.UnLock(); // judge winner winner = gameController.GetWinner(); if (winner != 0) { _gameBoard.Lock(); if (winner == 1) { // black wins this.lblTurn.Text = "Black Won"; } else { // white wins this.lblTurn.Text = "White Won"; } return(false); } this.lblTurn.ForeColor = Color.Green; this.lblTurn.Text = "Your Turn"; this.passedTime = 0; this.timer.Start(); return(true); }