Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Chapter 5, Exercise 5 (http://www.alice.org/community/showthread.php?t=4202)

Malladus 04-06-2010 05:10 PM

Chapter 5, Exercise 5
 
This is on page 237 of the textbook.

I'm having trouble making the object parameter actually go to something. I want it to be set by a user input.

The magician asks what object needs to disappear. User specifies which of the 3 to disappear. However, when I use the object parameter, it does not give me an option to set that parameter as what the user input was. I also have to make sure that I follow this:

"not reference any objects directly in the makeDisappear method. Instead, use the object parameter to determine which object will disappear. When you create the call to the makeDisappear method from world.animation, you will be prompted to specify the object that will be used by makeDisappear. Also note, that since there are 3 objects, you will need to call makeDisappear 3 times in world.animation)".

I'm obviously missing something, and I feel the chapter didn't cover object parameters that much. I don't see a way to make the object parameter interact with a string from a user input, so having both really results in nothing. : (

lanceA 04-06-2010 08:11 PM

You pass the Object as a parameter. You need a method that receives an Object as a parameter.


All times are GMT -5. The time now is 03:21 AM.

Copyright ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.