Alice Community  

Go Back   Alice Community > General Discussion > The Lounge

Reply
 
Thread Tools Display Modes
The complicated loop
Old
YoungCrazE
Junior Member
 
Status: Offline
Posts: 14
Join Date: Jan 2011
Location: I live EVERYWHERE!
Question The complicated loop - 03-07-2011, 01:43 AM

I can't really understand the loop program in this Alice program. I tried to make it to where an action would occur until you selected to stop the action, but I had to use "while" instead since it's a lot easier to understand and deal with.

Also, does anyone know how to make the program to respond to words typed in?
Example: Girl spins. Girl asks "spin again?".
Is there a way to make a text box so that the user can type in the word "yes" or "no" in order to reply to the program?

Thanks
   
Reply With Quote
Old
David B
Senior Member
 
David B's Avatar
 
Status: Offline
Posts: 1,145
Join Date: Dec 2010
Location: N/A
Default 03-07-2011, 08:10 AM

Quote:
Originally Posted by YoungCrazE View Post
I can't really understand the loop program in this Alice program. I tried to make it to where an action would occur until you selected to stop the action, but I had to use "while" instead since it's a lot easier to understand and deal with.

Also, does anyone know how to make the program to respond to words typed in?
Example: Girl spins. Girl asks "spin again?".
Is there a way to make a text box so that the user can type in the word "yes" or "no" in order to reply to the program?

Thanks
I can't help you with the loop question. Sorry.

I can help you with the respinse thing. There is an "ask user" function, in which you can ask the viewer of the world a question. There are three types of "ask user" functions. They are ask user for number, ask user for string, and ask user yes or no. I also saw that you wanted to have the user type it yes or no. That is completely unnecessary. Simply use the ask user yes or no. Using the ask user yes or no function will give them two buttons that say yes or no. I have tried messing with Alice's Python code to add an additional ask user method, but it never works.
   
Reply With Quote
Old
reuben2011
Senior Member
 
reuben2011's Avatar
 
Status: Offline
Posts: 489
Join Date: Sep 2009
Location: Hawaii
Default 03-07-2011, 12:23 PM

Here is an example. Enjoy. Let me know if you need help understanding any part of it.
Attached Files
File Type: a2w spinningTest.a2w (482.3 KB, 16 views)


Projects
-Escape the Kitchen
-That ninja animation
-Hill Collision

Upcoming Projects
-Some penguin adventure game?
   
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.