public void EasyPlayer(List <int> Gameboard, GamePlay.Player player) { if (RowMove(Gameboard, (int)player)) { return; } else if (ColumnMove(Gameboard, (int)player)) { return; } else if (NumberOfRows == NumberOfColumns) { if (DiagnalMove(Gameboard, (int)player)) { return; } else { RandomPlayer(Gameboard, player); } } else { RandomPlayer(Gameboard, player); } }
public void NeuralNetPlayer(List <int> Gameboard, GamePlay.Player player) { QlearningPlayer.LoadNetwork("Tic-Tac-Toe.net"); List <int> NewGameboard = QlearningPlayer.MakeMove(Gameboard, (int)player); Gameboard.Clear(); Gameboard.AddRange(NewGameboard); }
public void RandomPlayer(List <int> Gameboard, GamePlay.Player player) { int Move; do { Move = RND.Next(0, Gameboard.Count); }while (Gameboard[Move] != 0); Gameboard[Move] = (int)player; }
public void HardPlayer(List <int> Gameboard, GamePlay.Player player) { if ((int)player == 1 && Gameboard[0] == 0) { Gameboard[0] = 1; return; } else if ((int)player == -1 && Gameboard[4] == 0) { Gameboard[4] = -1; return; } else { EasyPlayer(Gameboard, player); } }