Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP PHP Arrays and Control Structures PHP Loops Ping Pong

Waqar Mohammad
Waqar Mohammad
2,914 Points

The rules of the game state to win a round you need 11 as a minimum score, but the output is not requiring that.

The rules of the game state to win a round you need 11 as a minimum score, but the output is not requiring that?

Hi Waqar,

Can you give the time in the video where the output is not requiring that?

3 Answers

I'm not sure but are you confusing the points with the round number?

It looks like the script was tested twice.

At 6:20 in the video you can see the results of the first run. It shows that player2 has 11 points and it's at least 2 points higher than player1 so it ends.

At 7:29 is the second results. It ends with player2 having 11 points.

Waqar Mohammad
Waqar Mohammad
2,914 Points

Hi Jason,

From what I understand, a player has to reach 11 points && be clear by 2 points to win the round - so 13/11 or 11/9 etc. If you look at the video @ 6.13 it shows a few rounds in which the condition of 11 points hasn't been met. Or am I mistaken?

Those rules are for winning the game.

Each round one of the players will get a point.

Then at the end of each round the players points are checked against the rules to see if there is a winner or if it needs to go another round.

You can think of it as a game is made up of multiple rounds.

Here's the rules from the Teacher's Notes:

To Win

    player must reach a score of 11
    player must be a minimum of 2 points higher than opponent

WHILE those conditions are NOT met, a single player will receive 1 point at the end of each round.
Waqar Mohammad
Waqar Mohammad
2,914 Points

@Jason, Thanks for getting back. Its throughout the video. The out put code doesn't require the games to go up to 11 points?

Waqar