#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# Math problem

Posts: 1,159Member

Hey guys!
I could use some help with a calculation, since i totally suck at math

Think asteriods for the big picture.

If my spaceship has three different kinds of ammo which is randomly loaded for me to fire, and I have six enemies in my level that is randomly genereted but only gets destroyed when hit with the right ammo. How do I calculate how many rounds of ammo I need (in total) to start with to be sure I can take all enemies out?

• London, UK.Posts: 12,822Member
edited June 2014

@Dues said:
Hey guys!
I could use some help with a calculation, since i totally suck at math

Think asteriods for the big picture.

If my spaceship has three different kinds of ammo which is randomly loaded for me to fire, and I have six enemies in my level that is randomly genereted but only gets destroyed when hit with the right ammo. How do I calculate how many rounds of ammo I need (in total) to start with to be sure I can take all enemies out?

If the ammo and enemies are chosen randomly then to ensure you can take all the enemies out you will need an infinite amount of ammo.

• Posts: 11,715Member, Sous Chef, PRO, Senior Sous-Chef

@Socks is right... although probability says that each type of ammo has a 33% chance of being chosen. And each enemy has an 8% chance. Let's say each enemy takes one bullet to destroy. After 10 chances, you'll have 3 of each bullet and 1 of each enemy (roughly). So you should be able to destroy everything. But probability isn't always reality.

New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

• Posts: 1,159Member

Aah I see!
Thanks @Socks‌ and @tatiang‌ !