Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Thread Tools Display Modes
Chapter 5, Exercise 5
Posts: n/a
Post Chapter 5, Exercise 5 - 04-06-2010, 05:10 PM

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. : (
Reply With Quote
Posts: n/a
Default 04-06-2010, 08:11 PM

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

Thread Tools
Display Modes

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 Jump

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