Alice Community  

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

Reply
 
Thread Tools Display Modes
The Item and From statement?
Old
iloveboarding
Guest
 
Status:
Posts: n/a
Default The Item and From statement? - 01-11-2011, 02:51 AM

Hello,

I was finally able to open-up the file submitted regarding the ground world example for the Big12 questions. I'm wondering, where did you find the item and from statement which is the last command in that example? I have been unable to locate it, so was curious if you could let me know... I wanted to play around and see if I could get it to work.

Thanks,
Iloveboarding
   
Reply With Quote
I'm still confused and need help!!!!! Please respond!!!!
Old
Southern Belle
Guest
 
Status:
Posts: n/a
Unhappy I'm still confused and need help!!!!! Please respond!!!! - 03-27-2011, 09:00 PM

Quote:
Originally Posted by x2495iiii View Post
Rank is the number variable you'd need (and I assumed you already had, sorry) to get this program done. Also, if you look at my code, I never called for the "ask user for a number" function to be dragged onto an if/else if argument, only that it be dragged onto the Rank variable's value.

First, create a new number variable called "Rank"
Then, create a list of strings called "Teams" which has the teams in order, 0-11

If [ask user for a yes or no: title = "Would you like to enter a rank?"]
then
Rank set value to [ask user for number: title = "Enter a rank number"]
if Rank < 1 or Rank > 12
then
Person say "Enter another number"
else
Rank set value to Rank - 1
Person say "Team " (joined with) [[Rank] as a string] (joined with) " is " (joined with) [rank]th item from Teams.
else
do nothing
----------------------------------------------

when you say create a list of strings is that from the menu of creating a new variable and select create list? I'm just not getting the process.

would appreciate any and all help you can provide, thanks!

southern belle
   
Reply With Quote
I can help
Old
marym
Junior Member
 
Status: Offline
Posts: 1
Join Date: May 2012
Location: Va
Default I can help - 05-06-2012, 06:28 PM

The code given by the obviously experienced user in incorrect.

First set up one variable. You can name it Team and set it to a number
add a person to the world
Second drag Team to the editor and select "ask user a question" from the World function tab. Have it ask the user for a number between 1 and 12
Next drag an if/else statement from the bottom of the editor (make sure the question is not in this box. I learned this the hard way).
Set it to "true"
Drag the "Team tile" and make it ==to 1
under that should be a space that says "do nothing" and under that is "else". In the space that says "do nothing" add your person says and the name of the first team.
Then add another if/else statement into the "else" space of that original if/else box.
Repeat these steps "team ==2, 3, etc" and make sure to add the if/else boxes into the else space of the previous box. It will be 12 layers of boxes
When you get to the last one in the else space put your person says "invalid"
Now, only the numbers 1-12 will be valid entries and all others will be invalid.
   
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 ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.