You need to read the assignment again.
Also go to wikipedia and read about the Game of Life so you understand what the program is supposed to do.
Type: Posts; User: Norm
You need to read the assignment again.
Also go to wikipedia and read about the Game of Life so you understand what the program is supposed to do.
Are any of those variables in the code you posted?
I only see three places where you read in data from the user.
What other 5 variables?
A suggestion for testing.
Forget about getting input from the user until you get the program's logic working. Hard code some good testing values for now:
numRows = 8; //console.nextInt();
numCols...
Take it one step at a time.
Do you have it going through the 5 cycles yet?
Get that working before trying to save and display the statistics.
I don't know if there is an easy way to exit from a next method that is waiting for user input.
What if you ask separately for each of the inputs so the user knows what the next number to be...
Can you explain what your problem is now?
You can use the Scanner's has... method to detect if there is any input to read.
Will that allow you to detect that the user has not entered all the input you want?
Try it and see what the effect...
if(matrix[r][c] = false)
That is an assignment statement not a comparison.
You do NOT need to compare the value of a boolean. Use its value directly:
if(!matrix[r][c])
The tri compare statement could work:
String val = (boolean ? "#" : "-");