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 trialJ.D. Sandifer
18,813 PointsUnclear question about while loop...
Seems like you just need to insert the ">" for the comparison and a ")" and a "{" to close the comparison and open the loop code...but that doesn't work.
What's needed to correctly answer this question?
2 Answers
Steve Hunter
57,712 PointsIt is
while (remainingTries > 0 && !dunkTank.isDunked()) {
The window scrolls to the right which makes it all so much clearer!! The massive underlines need reducing in length to make that easier to see.
Steve.
Steve Hunter
57,712 PointsThe throwBall()
will decrement remainingTries
.
J.D. Sandifer
18,813 PointsThere is no scrollbar for me so I had no idea...I saw nothing after the last blank.
Thanks for your help - it was much easier to answer after I saw the full question!
Steve Hunter
57,712 PointsHi J.D.
I agree, this isn't very clear at all. I've not done this course so am unaware of any context behind the question.
But, while I agree with your suggestion of adding the symbols you suggest, that leaves the dunkTank.isDunked
bit out on a limb and with no trailing semicolon.
I'd love to know the answer to this!
Steve.
J.D. Sandifer
18,813 PointsJ.D. Sandifer
18,813 PointsI realized that we also need to decrement
remainingTries
.However, "
>
", ") {
", andremainingTries--;
still doesn't work...