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

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??