Alice Community Sentinel Loop Exercise

 Sentinel Loop Exercise
 gskidmark Guest   Status: Posts: n/a Sentinel Loop Exercise - 05-14-2011, 10:05 AM I am stuck on exercise 3 at the end of chapter 4. The exercise is this: Add a tree to the triple jump while loop world. Make the sentinel to be the tree's height, rather than the number 5., so that the loop will execute when the distance is less than or equal to the tree's height, but stop when the distance passes its height. To do this, you can use the character-level function that returns an object's height. I added a birch tree to the world. I am keeping the counter. I am changing the while instruction to tell it to keep running as long as long as the distance the whiteRabbit is traveling is less than or equal to the height of birchTree. I kept the counter and tried these while instructions: While birchTree height is below whiteRabbit height While birchTree height is >/= whiteRabbit distance above ground While whiteRabbit distance to ground is < birchTree height None of these worked. I then realized that I am missing the character-level function that returns an object's height. I am not sure if any of those while instructions are correct but I won't know until I get it to report the object's height. I must be overlooking something in the book because I do not know how to get it to report this. Can someone point me in the right direction?

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home Announcements     Community News and Announcements Alice 3     How Do I?     Works In Progress     Share Your World     Share Custom Classes     Bugs and Trouble Shooting     Suggestion Box Alice 2     How do I...?     Works-In-Progress     Share Worlds     Share Objects     Bugs and Troubleshooting     Suggestion Box Educators     Teaching with Alice     Teaching Using Alice 3     Teaching Using Alice 2     CS Principles and Alice     AP CSA and Intro to Java and Alice     Workshops     Alice Player and VR General Discussion     Questions and Comments     The Lounge