Search:

Type: Posts; User: Norm

Search: Search took 0.13 seconds.

  1. Replies
    14
    Views
    1,676

    Re: Ping Pong Table - Issues with Scores

    When the score is changed to the max value, when will the posted code detect that and call the display method?

    Play computer with the code and see when each section of the code will be executed.
  2. Replies
    14
    Views
    1,676

    Re: Ping Pong Table - Issues with Scores

    Does that mean you see the problem and are fixing it?

    Its not necessary to post the constants.
  3. Replies
    14
    Views
    1,676

    Re: Ping Pong Table - Issues with Scores

    where in the code is the logic for that? The posted code says that this computerScore == WINNING_SCORE must be true for the display method to be called.
    Can you copy the console's contents that...
  4. Replies
    14
    Views
    1,676

    Re: Ping Pong Table - Issues with Scores

    What happens when you compile and execute the code?
    Does it do what you want?

    There are too many spaces in the posted code pushing it too far to the right and making it very hard to read.
  5. Replies
    14
    Views
    1,676

    Re: Ping Pong Table - Issues with Scores

    If you test the value of score BEFORE adding to it and not add to it if its value is too high, then its value should never be increased.

    In pseudo code
    test score against max
    if less than max...
  6. Replies
    14
    Views
    1,676

    Re: Ping Pong Table - Issues with Scores

    You could test if the score is at the max and only increment it if it is less than max.
  7. Replies
    14
    Views
    1,676

    Re: Ping Pong Table - Issues with Scores

    Is that what you want to happen? Always? Your first post hinted that there was a problem:
  8. Replies
    14
    Views
    1,676

    Re: Ping Pong Table - Issues with Scores

    What logic determines when the score is to be incremented and when it is not to be incremented and left as is?

    The unformatted code that was posted is hard to read and understand.
    Please edit...
Results 1 to 8 of 8