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

#1 2011-10-17 18:30:13

Trev92
New Scratcher
Registered: 2011-10-17
Posts: 6

Help with setting up equations?

Hey, I'm trying to set up a zombie-shooter type game, where when you solve equations you get ammo which will then allow youto shoot the zombies.  I'm not to sure how to set this up however, like the solving match equations and how that would give you 1 bullet. Any help would be greatly appreciated!

Offline

 

#2 2011-10-18 02:52:55

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Help with setting up equations?

Here's my (not so neat but workable) version:

Set ammo to 0
forever:
|Set (i) to (Pick random(1)to(length of [math problems])
|ask(item(i)of[math problems]) and wait
|If <(answer)=(item(i)of[answers])>
||Change ammo by 1

With these lists:

Math problems:
1+1
3*3
√9

Answers:
2
9
3

Last edited by Hardmath123 (2011-10-18 02:53:19)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

Board footer