Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Objective-C Basics Practicing with Immersive Examples Immersive example 1 - Ping-Pong

Calvin Liem
Calvin Liem
3,599 Points

winByTwoPoints

in the video 12:59

nateScore is 21 kyleScore is 16

that game should be over when nate score 19 right? 2 point different

is this intentional or gabe codes wrong?

2 Answers

Nathan Barnes
PLUS
Nathan Barnes
Courses Plus Student 13,996 Points

In the video Gabe says its the first player to reach 21 points or more and is ahead by at least two points, so if Nate reaches 19 points it doesn't matter because neither of them have reached the required minimum of 21 points

Does that make sense?

Calvin Liem
Calvin Liem
3,599 Points

maybe i dont get this right but "ahead by two points" means the different between them should be two point right? so the game must ended when nateScore is 19 because 19 vs 16 is ahead of 2 points right?

so why the game ended with 21 points on nate and 16 points on kyle thats a 5 point different (nate is ahead 5 point) <-- should be 2 points right??