Sh0cker_
02-19-2008, 04:26 PM
I hope this is in the correct part of the forum.
I'm trying to teach myself Alice Programming and I came across a book entitled "An introduction to programming using Alice" I of course picked it up and made my way thru till the end here. I've been doing the exercises at the end of each chapter and I find myself to be stuck on this last one.
1. The Bugs folder inside the Animals folder in the Alice Local Gallery contains a Butterfly class of objects. You will use that class to complete this program.
* Create a new Alice world with six butterflies in a list that will make all of the butterflies fly around gently, flapping their wings and moving about gently.
-Position six butterflies (from the Bugs folder inside the Animals folder) into your world.
-This Butterfly class does NOT contain a flap method.
-Create a generic world flap method that uses a parameter (such as who) to specify the butterfly.
- The flap method should only make any one butterfly flap once. It should not contain a loop.
-Do not use any random functions in this method.
-Create a generic world move method that uses a parameter (such as who) to specify the butterfly.
-The move method should make any one butterfly change direction. No loops here either.
-Use a random function to determine the turn or move direction. (Left, Right, Up, Down, Forward, Backward)
-Use a random function to determine the turn or move distance. (Use small values.)
-The When the world starts event should call the Main method.
-This should be the only event used in this program
-The Main method should contain a loop that calls the generic flap and generic move methods.
-Use a For All together control statement that uses a Butterfly list to obtain the butterfly to pass by parameter to the flap and move methods.
-The loop should allow the butterflies to fly smoothly and remain on the screen for at least 20 seconds without user intervention.
-Do not use any random functions in this method.
*Lost*
- Sh0cker_
Any help starting me out in the right direction would be appreciated.
I'm trying to teach myself Alice Programming and I came across a book entitled "An introduction to programming using Alice" I of course picked it up and made my way thru till the end here. I've been doing the exercises at the end of each chapter and I find myself to be stuck on this last one.
1. The Bugs folder inside the Animals folder in the Alice Local Gallery contains a Butterfly class of objects. You will use that class to complete this program.
* Create a new Alice world with six butterflies in a list that will make all of the butterflies fly around gently, flapping their wings and moving about gently.
-Position six butterflies (from the Bugs folder inside the Animals folder) into your world.
-This Butterfly class does NOT contain a flap method.
-Create a generic world flap method that uses a parameter (such as who) to specify the butterfly.
- The flap method should only make any one butterfly flap once. It should not contain a loop.
-Do not use any random functions in this method.
-Create a generic world move method that uses a parameter (such as who) to specify the butterfly.
-The move method should make any one butterfly change direction. No loops here either.
-Use a random function to determine the turn or move direction. (Left, Right, Up, Down, Forward, Backward)
-Use a random function to determine the turn or move distance. (Use small values.)
-The When the world starts event should call the Main method.
-This should be the only event used in this program
-The Main method should contain a loop that calls the generic flap and generic move methods.
-Use a For All together control statement that uses a Butterfly list to obtain the butterfly to pass by parameter to the flap and move methods.
-The loop should allow the butterflies to fly smoothly and remain on the screen for at least 20 seconds without user intervention.
-Do not use any random functions in this method.
*Lost*
- Sh0cker_
Any help starting me out in the right direction would be appreciated.