System.out.println("White has been CHECKed!\nbe careful!");
else
System.out.println("Black has been CHECKed!\nbe careful!");
}
changeTurn();
returntrue;
}
privatevoidchangeTurn(){
turn*=-1;
}
publicString[]getInput(){
if(turn==1)
System.out.println("White turn:");
else
System.out.println("Black turn:");
String[]strings=newString[2];
Scannerinput=newScanner(System.in);
StringuserInput;
booleanbreak_=false,continue_;
do{
if(turn==1)
System.out.print("WHITE>");
else
System.out.print("BLACK>");
userInput=input.nextLine();
userInput=userInput.trim().toLowerCase();
continue_=false;
if(userInput.equals("help")){
System.out.println("First Enter nut location and then enter destination.\nfor example: 'e2 b5' for move the nut in e2 to b5\ncapitals characters are white and others are black\np = pawn, r = rook, k = knight\nb = bishop, q = queen, x = king");
System.out.println("WELCOME!\nFor Move: Enter nut location and then enter destination.\nfor example: 'a1 h8' for move the nut in a1 to h8\nFor Get Help: Enter 'help'\nand if a player wants to resign enter 'resign'");
showPlayGround();
System.out.print("Ready?\nPress Enter to Start!");
Scanneri=newScanner(System.in);
i.nextLine();
}
publicvoidshowPlayGround(){
System.out.print(" a b c d e f g h\n _ _ _ _ _ _ _ _\n");