Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

  1. Replies
    24
    Views
    3,123

    Re: Can't run Game of Life programm

    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.
  2. Replies
    24
    Views
    3,123

    Re: Can't run Game of Life programm

    Are any of those variables in the code you posted?
    I only see three places where you read in data from the user.
  3. Replies
    24
    Views
    3,123

    Re: Can't run Game of Life programm

    What other 5 variables?
  4. Replies
    24
    Views
    3,123

    Re: Can't run Game of Life programm

    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...
  5. Replies
    24
    Views
    3,123

    Re: Can't run Game of Life programm

    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.
  6. Replies
    24
    Views
    3,123

    Re: Can't run Game of Life programm

    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...
  7. Replies
    24
    Views
    3,123

    Re: Can't run Game of Life programm

    Can you explain what your problem is now?
  8. Replies
    24
    Views
    3,123

    Re: Can't run Game of Life programm

    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...
  9. Replies
    24
    Views
    3,123

    Re: Can't run Game of Life programm

    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])
  10. Replies
    24
    Views
    3,123

    Re: Can't run Game of Life programm

    The tri compare statement could work:
    String val = (boolean ? "#" : "-");
Results 1 to 10 of 10