You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
System.out.println("\nThe board is a big cookie - R rows high and C columns \nwide. You input R and C at the start. In the upper left\ncorner of the cookie is a poison square (P). The one who\nchomps the poison square loses. To take a chomp, type the\nrow and column of one of the squares on the cookie.\nAll of the squares below and to the right of that square\n(Including that square, too) disappear -- CHOMP!!\nNo fair chomping squares that have already been chomped,\nor that are outside the original dimensions of the cookie.\n");
System.out.println("Here we go...\n");
}
startGame();
}
private void startGame(){
System.out.print("How many players ");
numberOfPlayers = scanner.nextInt();
while(numberOfPlayers < 2){
System.out.print("How many players ");
numberOfPlayers = scanner.nextInt();
}
System.out.print("How many rows ");
rows = scanner.nextInt();
while(rows<=0 || rows >9){
if(rows <= 0){
System.out.println("Minimun 1 row is required !!");
}
else{
System.out.println("Too many rows(9 is maximum). ");
}
System.out.print("How many rows ");
rows = scanner.nextInt();
}
System.out.print("How many columns ");
cols = scanner.nextInt();
while(cols<=0 || cols >9){
if(cols <= 0){
System.out.println("Minimun 1 column is required !!");
}
else{
System.out.println("Too many columns(9 is maximum). ");