Alice Community  

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

Reply
 
Thread Tools Display Modes
how do i ask user for input
Old
Gamma God
Guest
 
Status:
Posts: n/a
Question how do i ask user for input - 06-09-2009, 04:23 PM

how do i ask the user of my alice world for their input like for Hangman like guessing?
   
Reply With Quote
Old
ttkrakus
Guest
 
Status:
Posts: n/a
Default 06-10-2009, 10:34 PM

Please find attached an example that uses the "ask user for string" function to request text data from the person executing the Alice world.

The animation shows Penguin getting closer to the camera and asking for a password (which is penguin). Whatever the user enters it is stored in a world variable called world.answer. A while loop is then used to validate this password (basically, if the password entered is not penguin, then it asks again for a password).

Once the right information is provided, the penguin turns and walks away.
Attached Files
File Type: a2w penguin_asks.a2w (495.4 KB, 50 views)

Last edited by ttkrakus; 06-10-2009 at 10:36 PM.
   
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.