ANSWER TO EXERCISE 10 | |
Object television "portable television set" lounge with name "tv" "television" "set" "portable", before [; SwitchOn: <<SwitchOn power_button>>; SwitchOff: <<SwitchOff power_button>>; Examine: <<Examine screen>>; ], has transparent; Object -> power_button "power button" with name "power" "button" "switch", after [; SwitchOn, SwitchOff: <<Examine screen>>; ], has switchable; Object -> screen "television screen" with name "screen", before [; Examine: if (power_button hasnt on) "The screen is black."; "The screen writhes with a strange Japanese cartoon."; ]; |