Ejemplo n.º 1
0
        /// <summary>
        /// Do brute force for the opponent turn logic
        /// </summary>
        /// <param name="gl"></param>
        /// <param name="p"></param>
        /// <param name="me">the AI sign (X or O)</param>
        /// <returns></returns>
        private int oRBruteForce(GameLogic gl, int current_depth)
        {
            //todo
            depth++;
            var ex         = new GameLogic(gl);
            int freespaces = ex.GetFreeSpaces();
            var positions  = ex.AllFreeSpaces();

            return(-1);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// procceding to win and "thinks" about the further game.
 /// </summary>
 /// <param name="gl">The <seealso cref="GameLogic"/> of the game the ai playing.</param>
 /// <returns></returns>
 private Position Hard(GameLogic gl)
 {
     if (gl.GetFreeSpaces() == 0)
     {
         return(new Position(-1));
     }
     if (EasyWin(gl).row != -1)
     {
         return(EasyWin(gl));
     }
     if (MustPut(gl).row != -1)
     {
         return(MustPut(gl));
     }
     if (Tricks(gl).row != -1)
     {
         return(Tricks(gl));
     }
     return(gl.AllFreeSpaces()[0]);
     //return BruteForce(gl, CellE.o);
 }