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)); }
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); }
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); }
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); }
static void Main(string[] args) { SimpleChess.Play(); }