Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed PHP Arrays and Control Structures!

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
In this video, we'll create a simple ping pong game to demonstrate another use case for while loops.
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.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Robert Bourton
4,751 Points3 Answers
-
Carlos Zuluaga
21,184 Points2 Answers
-
Anastasia Khmelevskaya
1,775 Points2 Answers
-
Door Man
1,711 Points2 Answers
-
yahya alhalki
1,149 Pointswhy do we have to put parentheses round ($player1 < 11 && $player2 < 11) )?
Posted by yahya alhalkiyahya alhalki
1,149 Points2 Answers
-
Alexei Parphyonov
34,128 Points1 Answer
-
nathan goel
7,410 PointsI guess I don't really understand && and ||...help please
Posted by nathan goelnathan goel
7,410 Points1 Answer
-
Yoel Dovid Cohen
13,405 Points1 Answer
-
Emil Pesaxov
3,684 Points1 Answer
-
Waqar Mohammad
2,914 Points3 Answers
-
MOD
Jonathan Grieve
Treehouse Moderator 91,254 Points1 Answer
-
Aaron Coursolle
18,014 Points0 Answers
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up