Help with Lightbulb lab and creating a Boolean function. -
09-27-2008, 11:24 PM
Here is my lab:
"Create a world with a lightbulb (lights) and a method turnOnOff that turns the lightbulb on/off depending on whether it is already on/off. When the lightbulb is on, its emissive color property has a value of yellow. When the lightbulb is off, the emissive color is black. Write a Boolean function isLightOn that returns true if he light bulb is on and false if it is off. When clicked, the lightbulb should turn on/off."
Here is what I have done so far:
1. Put the lightbulb into a room setting.
2. Wrote a method turnOnOff that looks like this:
lightbulb: set color to: black
lightbulb: set color to: yellow
3. Created a new event saying:
When mouse is clicked on 'lightbulb', do "lightbulb.turnOnOff"
(I do not know if step #3 was necessary it just seemed like something to do)
4. I started a new function calling it isLightOn. I pressed "Boolean" and now I'm completely stuck!
I need help getting the boolean function to work properly, and I need to know if I am supposed to put the event that I put in.
Thank you! Any help is appreciated! It is due Sunday night. I have a textbook but it really doesn't help me very much.
Last edited by gordee; 09-28-2008 at 03:13 PM.
|