Math problem

DuesDues Member Posts: 1,159

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?

Comments

  • SocksSocks London, UK.Member Posts: 12,822
    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.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @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

  • DuesDues Member Posts: 1,159

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

Sign In or Register to comment.