Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Replies
    28
    Views
    2,761

    Re: Help altering dice program?

    The code is probably in an infinite loop. To find where the loop is, you need to do some debugging. Add some println statements that print out messages as methods are called and as loops are...
  2. Replies
    28
    Views
    2,761

    Re: Help altering dice program?

    Please post the code for the whole program.

    Don't hide }s at the end of a statement. That makes the code hard to read and understand. }s should be on a line by itself.
  3. Replies
    28
    Views
    2,761

    Re: Help altering dice program?

    The compiler found a call to minValue() that did not have an arg.
    You must ALWAYS pass an arg to minValue(). minvalue will use the value passed to it in the current call to the method, not one...
  4. Replies
    28
    Views
    2,761

    Re: Help altering dice program?

    If minValue() requires an int parameter, the code needs to give it a parameter.
  5. Replies
    28
    Views
    2,761

    Re: Help altering dice program?

    Yes, that looks closer.
    minValue returns false too soon. It should wait until all of the elements have been tested.

    You should Add a comment to the code saying what the method is supposed to do....
  6. Replies
    28
    Views
    2,761

    Re: Help altering dice program?

    First get a design to describe what the code is to do. Then work on coding it.
    I suggested an approach in posts #8 & #10
  7. Replies
    28
    Views
    2,761

    Re: Help altering dice program?

    Putting two statements on the same line sort of hides the second statement and makes the code hard to read:

    if(scoreboard[j] != value)multiToss();

    Would that statement stop any additions to the...
  8. Replies
    28
    Views
    2,761

    Re: Help altering dice program?

    What happened to the loop in multiToss() that was supposed to continue executing until all the counts were at desired value? See post#10
  9. Replies
    28
    Views
    2,761

    Re: Help altering dice program?

    That only tests 1 of the possible counts.
    What are the valid values of the score variable? Does it ever get > 12?
    Where are the counts that you want to compare against?
  10. Replies
    28
    Views
    2,761

    Re: Help altering dice program?

    The loop needs to continue until the condition is met.
    Use a while loop that continues executing until the method that checks if the condition is met returns true.
    while(not done) {
    compute...
  11. Replies
    28
    Views
    2,761

    Re: Help altering dice program?

    Then there needs to be code inside the loop that tests if all the counts are at the desired level.
    A good solution would be to call a method that returned a boolean: true if the counts are at the...
  12. Replies
    28
    Views
    2,761

    Re: Help altering dice program?

    Does that mean that the program should continue executing the loop until all the roll counts are >= the value entered by the user?
  13. Replies
    28
    Views
    2,761

    Re: Help altering dice program?

    Can you explain what is wrong with that output? What do you want to see in the second column.
    I assume the first column is just a row number.


    System.out.println("toss of "+ j + " " +...
  14. Replies
    28
    Views
    2,761

    Re: Help altering dice program?

    Can you post the current output for comparison so we can see what is wrong?
Results 1 to 14 of 14