Beispiel #1
0
        public void PutPiace(Player player, string pieceType, string horizontal, int vertical)
        {
            int x = SimpleChess.GetHorizontalIndex(horizontal);
            int y = vertical - 1;

            this.PutPiace(CreatePiece(player, pieceType, x, y));
        }
Beispiel #2
0
        public override List <KeyValuePair <int, int> > GetAvaliableMovements(int boardSize)
        {
            var result = new List <KeyValuePair <int, int> >();

            for (int i = 0; i < boardSize; i++)
            {
                SimpleChess.AddIfPosible(result, boardSize, i, this.Y);
                SimpleChess.AddIfPosible(result, boardSize, this.X, i);
            }
            return(result);
        }
Beispiel #3
0
        public override List <KeyValuePair <int, int> > GetAvaliableMovements(int boardSize)
        {
            var result = new List <KeyValuePair <int, int> >();

            SimpleChess.AddIfPosible(result, boardSize, this.X + 2, this.Y + 1);
            SimpleChess.AddIfPosible(result, boardSize, this.X + 2, this.Y - 1);
            SimpleChess.AddIfPosible(result, boardSize, this.X - 2, this.Y + 1);
            SimpleChess.AddIfPosible(result, boardSize, this.X - 2, this.Y - 1);

            SimpleChess.AddIfPosible(result, boardSize, this.X + 1, this.Y + 2);
            SimpleChess.AddIfPosible(result, boardSize, this.X + 1, this.Y - 2);
            SimpleChess.AddIfPosible(result, boardSize, this.X - 1, this.Y + 2);
            SimpleChess.AddIfPosible(result, boardSize, this.X - 1, this.Y - 2);
            return(result);
        }
Beispiel #4
0
        public override List <KeyValuePair <int, int> > GetAvaliableMovements(int boardSize)
        {
            var result = new List <KeyValuePair <int, int> >();

            for (int i = 1; i < boardSize; i++)
            {
                //sol-üst çapraz
                SimpleChess.AddIfPosible(result, boardSize, this.X + i, this.Y + i);

                //sol-alt çapraz
                SimpleChess.AddIfPosible(result, boardSize, this.X + i, this.Y - i);

                //sağ-üst çapraz
                SimpleChess.AddIfPosible(result, boardSize, this.X - i, this.Y + i);

                //sol-alt çapraz
                SimpleChess.AddIfPosible(result, boardSize, this.X - i, this.Y - i);
            }
            return(result);
        }
Beispiel #5
0
 static void Main(string[] args)
 {
     SimpleChess.Play();
 }