Alice Community  

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

Reply
 
Thread Tools Display Modes
How do I have Alice Calculate a Math Problem
Old
rossim0
Guest
 
Status:
Posts: n/a
Default How do I have Alice Calculate a Math Problem - 01-30-2010, 01:41 PM

I have already done the animation to this project. I need the work to ask how many miles it may be to a place. Then, what is the speed limit. These i guess would be two separate variables. Then the person in the program divides the speed limit by the miles and comes up with a time it will take to get to the place. They cant be fixed numbers because it has to work for any random numbers. So in order...

Miles are asked for input by the user
Speed Limit is asked for input by the user
car drives up
person turns to car, and then away
Person then answers equation which is basically speed limit divided by miles

Just having an issue getting division equation into this program.

I have attached my file & would appreciate any help. I'm really bad with variables. Thanks a lot.
Attached Files
File Type: a2w Road to Hana.a2w (834.6 KB, 154 views)
   
Reply With Quote
Old
zonedabone
Senior Member
 
zonedabone's Avatar
 
Status: Offline
Posts: 578
Join Date: Nov 2008
Location: In the interwebs
Default 01-30-2010, 07:00 PM

Ok! I'm here to help.

First, you're going to want to make variables. Go into the world's properties, and select create variable. Type the name "Distance" into name, and select number as the type. Repeat this process, except name it "Speed"

Next, drag the "Distance" variable into the event, end set it's value to anything. Go into the world's functions, and drag "Ask user for a string" into the number box. Click other, and type a question about the distance. Repeat this for the "Speed" variable.

Third, drag the variable "Distance" set it's value to itself, found under expressions. click on this reference, and select math. Click "Distance/", and select time under expressions.

Where you want it have the zombie say something. Under the world's functions, drag"What as a string" into the value. Drag distance into that. You're done!


'Apple Macintosh' - An anagram of 'Complaints Heap'

M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs.

You're *such* a mac person.
   
Reply With Quote
A few issues with your reply
Old
rossim0
Guest
 
Status:
Posts: n/a
Default A few issues with your reply - 01-30-2010, 11:50 PM

I really appreciate you taking the time to help me out, but I am having some issues, I have uploaded what i have done so far following your guidelines.

1. When I create the distance variable and add it into my "world.my first method" as the first method, I am not able to put ask user for a string int he number section, it doesn't accept it. If you check out my program I uploaded you will see what I have done to try and make it work.

2. Also, it seems that we are missing a A Time variable. Miles / Speed limit = Time. I don't know how to finish the program. I have got it so I input the numbers for speed and miles, how do I input the zombie saying the answer for the equation. Please if you have some time, checkout my program I made and let me know what I'm doing wrong. Thanks a lot. Cant tell you how much i appreciate your help.
Attached Files
File Type: a2w Road to Hana.a2w (837.5 KB, 287 views)
   
Reply With Quote
Old
zonedabone
Senior Member
 
zonedabone's Avatar
 
Status: Offline
Posts: 578
Join Date: Nov 2008
Location: In the interwebs
Default 01-31-2010, 06:17 PM

Oh! I'm so sorry! I accidently typed the wrong thing. I meant to say "Ask user for a number." Sorry!

I see that you successfully added the time variable. Drag this so that it's after the first two questions. Right click on "World.distance" within your time function, and then click on math. Click distance/, click expressions, and then speed. The variable will now be set as distance/speed.

The say bubble will be very advanced, but for now, simply have the zombie say something where you want him to. Next, drag "What as a string" from the world's functions into his text to say. Go to expressions, and select time.

Hope this helps!


'Apple Macintosh' - An anagram of 'Complaints Heap'

M.A.C.I.N.T.O.S.H. - Machine Always Crashes, If Not, The Operating System Hangs.

You're *such* a mac person.
   
Reply With Quote
How?
Old
Deathlaser
Junior Member
 
Status: Offline
Posts: 2
Join Date: May 2012
Thumbs down How? - 05-06-2012, 01:29 PM

How do I get alice to calculate simple math problems like 4+5

Like the user types in "4" and "+" and "5"

Hurry, I only have till tuesday.

Last edited by Deathlaser; 05-06-2012 at 01:33 PM. Reason: fix up
   
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 ©2018, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.