public bool coronation(int n3, int n4, Tool[,] tool, int numTurn) { bool loop = false; do { string input = ""; Console.WriteLine("Hooray! You were crowned! Choose what role the soldier will be crowned? \n 1 for rook,2 for bishop, 3 queen 4 for knight"); input = Console.ReadLine(); input = input.ToLower(); input = input.Trim(); switch (input) { case "1": tool[n3, n4] = new Rook(numTurn); return(true); case "2": tool[n3, n4] = new Bishop(numTurn); return(true); case "3": tool[n3, n4] = new Qween(numTurn); return(true); case "4": tool[n3, n4] = new Knight(numTurn); return(true); } } while (loop); // לולאה אינסופית return(false); }
public Tool[,] makeTools() { Tool[,] bord; bord = new Tool[8, 8]; for (int z = 0; z < 8; z++) { for (int i = 0; i < 8; i++) { if (z < 2) { bord[z, i] = new Pawn(1); } if (z < 6 && z > 1) { bord[z, i] = new Space(0); } if (z > 5) { bord[z, i] = new Pawn(2); } } } bord[0, 2] = new Bishop(1); bord[0, 5] = new Bishop(1); bord[7, 2] = new Bishop(2); bord[7, 5] = new Bishop(2); bord[0, 1] = new Knight(1); bord[0, 6] = new Knight(1); bord[7, 1] = new Knight(2); bord[7, 6] = new Knight(2); bord[0, 7] = new Rook(1);// bord[7, 7] = new Rook(2); bord[7, 0] = new Rook(2); bord[0, 3] = new Qween(1);; bord[7, 3] = new Qween(2); bord[0, 4] = new King(1); bord[7, 4] = new King(2); return(bord); }