Alice Community  

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

Reply
 
Thread Tools Display Modes
Getting an on/off switch to work.
Old
Rossco13
Guest
 
Status:
Posts: n/a
Default Getting an on/off switch to work. - 11-15-2009, 11:48 PM

I am doing exercise 7 of chapter 7 and can't get it to work using the While something is true event. What I have so far is a ferris wheel that spins so long as the light switch is in the up/green mode. What I want, and can't seem to figure out, is to have the ferris wheel stop when the switch is in the off/red mode.
Attached Files
File Type: a2w mr-ch7-stopAndStart.a2w (2.28 MB, 76 views)
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 11-16-2009, 01:10 AM

Try adding a boolean variable called "on" which is set to true when the switch is in the green, and false when its in the red. That way, all you need to do is have the ferris wheel's while loop check to see if "on" is true.


(')>
   
Reply With Quote
Old
Rossco13
Guest
 
Status:
Posts: n/a
Default 11-17-2009, 01:39 AM

I got it to work, thank you so much for your help.
   
Reply With Quote
Reply

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 ©2021, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.