This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-04-01 20:02:56

CoolPenguin
Scratcher
Registered: 2012-01-09
Posts: 39

*Help with Division Script*

I want to create a script for my game Math Frenzy, a game where you have 60 seconds to do as many math problems as you can. I want to do a Division script, but I want the 1st number to be divisible by the 2nd number, so I want everything to come out even. I think it has something to do with lists, but can someone help me out with a script? Thanks  smile

Offline

 

#2 2012-04-01 21:10:46

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: *Help with Division Script*

CoolPenguin wrote:

I want to create a script for my game Math Frenzy, a game where you have 60 seconds to do as many math problems as you can. I want to do a Division script, but I want the 1st number to be divisible by the 2nd number, so I want everything to come out even. I think it has something to do with lists, but can someone help me out with a script? Thanks  smile

Actually, what I would do is have the program pick two random numbers, multiply them, and then show the product over one of the numbers and the user has to type or choose the other random number.


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#3 2012-04-01 21:28:06

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: *Help with Division Script*

set [a] to (pick random (4) to (10))
set [b] to (pick random (4) to (10))
set [c] to ((divisor)*(dividend))
set [expression] to (join (c)(join[/](b)))
ask (join[what is ](expression)) and wait
if<(answer) = (a)>
correct
end
That should apply AtomicBawm3's solution.

Last edited by MoreGamesNow (2012-04-01 21:28:17)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

Board footer