Search:

Type: Posts; User: jps

Search: Search took 0.08 seconds.

  1. Re: Game of Life 2-D matrix random seed boolean array PLEASE

    Surely there is a way you can achieve your goal without doing the extra work of setting the value of most of your elements twice.
  2. Re: Game of Life 2-D matrix random seed boolean array PLEASE

    Yes that is why you use random.
    First you declare your variable and initialize it with the line of code:
    boolean[][] matrix = new boolean[numRows][numCols];
    Then there is no reason to set them all...
  3. Re: Game of Life 2-D matrix random seed boolean array PLEASE

    I don't understand what you mean here. It is my fault for so many posts. When you have a question about a post, you can quote it or refer to it to make it easier to follow what you mean in your reply.
  4. Re: Game of Life 2-D matrix random seed boolean array PLEASE

    I am not sure allowing the user control over your random generator's seed is exactly what you want, maybe it is. Ask yourself, is this something the user of your code needs to be able to do?

    I...
  5. Re: Game of Life 2-D matrix random seed boolean array PLEASE

    On a side note, in your readNums method you have a few lines of code I'd like to discuss:


    boolean[][] matrix = new boolean[numRows][numCols];

    createMatrix(matrix);
    for(int row = 1;...
  6. Re: Game of Life 2-D matrix random seed boolean array PLEASE

    Well you determined you wanted to set the matrix all to false. So when you call the method you would just do it that way. Just assume for a moment that your createMatrix method was replace with the...
  7. Re: Game of Life 2-D matrix random seed boolean array PLEASE

    The idea of javadoc is to educate the user of your code about your code. To get a good understanding, do a search for javadoc and just spend twenty minutes looking over existing documents. The html...
  8. Re: Game of Life 2-D matrix random seed boolean array PLEASE

    Your method:

    /**Creates a matrix with lengths entered and sets all values false*/
    private static void createMatrix(boolean[][] matrix)
    {
    for(int r = 0; r < matrix.length; r++)
    {...
  9. Re: Game of Life 2-D matrix random seed boolean array PLEASE

    Your javadoc comments should be complete sentences describing the purpose and function of the block of code they refer to. You can use @return and @param to describe specific parts of methods. For...
  10. Re: Game of Life 2-D matrix random seed boolean array PLEASE

    Much rather see the code on the forum rather than in an attachment.

    Just type

    Copy paste your code from your class file here.
    (ctrl+a to select all of your file followed by ctrl+c to copy to...
  11. Re: Game of Life 2-D matrix random seed boolean array PLEASE

    When pseudo-random numbers are generated a seed is used to determine a starting point. So say you make a random number generator and use seed 0. You start pulling nextBoolean one by one and say for...
Results 1 to 11 of 11