예제 #1
0
        private static ChessEngine.Engine.Engine PuzzleKingPawnCandidate()
        {
            ChessEngine.Engine.Engine engine = new ChessEngine.Engine.Engine("");
            Random random = new Random(DateTime.Now.Second);
            byte   index1;
            byte   index2;
            byte   index3;

            do
            {
                index1 = (byte)random.Next(63);
                index2 = (byte)random.Next(63);
                index3 = (byte)random.Next(63);
            }while ((int)index1 == (int)index2 || (int)index1 == (int)index3 || ((int)index2 == (int)index1 || (int)index3 <= 8) || ((int)index3 >= 56 || (int)index3 < (int)index2));
            Piece piece1 = new Piece(ChessPieceType.King, ChessPieceColor.White);
            Piece piece2 = new Piece(ChessPieceType.Pawn, ChessPieceColor.White);
            Piece piece3 = new Piece(ChessPieceType.King, ChessPieceColor.Black);

            engine.SetChessPiece(piece1, index1);
            engine.SetChessPiece(piece3, index2);
            engine.SetChessPiece(piece2, index3);
            engine.GenerateValidMoves();
            engine.EvaluateBoardScore();
            return(engine);
        }
 public SpeechRecognition(ChessEngine.Engine.Engine engine, ChessEngine.Controller.Controller controller)
 {
     this.engine     = engine;
     this.controller = controller;
     Initiate();
 }