• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

throw til you get a 9 statistics

ZorakBane

Smash Journeyman
Joined
Jan 8, 2002
Messages
447
Location
Kalamazoo, MI
==============
Hypothesis
==============
Throw a hammer until you 9 once per life

==============
Results
==============
Throwing a hammer until you 9 is still 14.28% or a 1/7 chance.

==============
Data
==============
How many lives do you want to test?
4
How many times do you want to test?
65000
After 1820996 throws Average = 14.28%
Average throws perlife before a 9 is 7.00

How many lives do you want to test?
4
How many times do you want to test?
65000
After 1818474 throws Average = 14.30%
Average throws perlife before a 9 is 6.99

How many lives do you want to test?
5
How many times do you want to test?
65000
After 2279487 throws Average = 14.26%
Average throws perlife before a 9 is 7.01

How many lives do you want to test?
20
How many times do you want to test?
65000
After 9108878 throws Average = 14.27%
Average throws perlife before a 9 is 7.01

==============
Code
==============
#include <stdio.h>
#include <time.h>

int ham(int last1, int last2);

int main(void)
{
srand(time(0));
int i=0, j, jj, x=0, last1=2, last2=1, counter=0, throwsperlife=0, lives, times, average=0;

printf("How many lives do you want to test?\n");
scanf("%d", &lives);
printf("How many times do you want to test?\n");
scanf("%d", &times);

for(jj=0; jj<times;jj++)
{
for(j=1; j<=lives; j++)
{
do
{
x = ham(last1, last2);
throwsperlife++;
last1=last2;
last2=x;

}while(x!=9);
counter++;
printf("Died, reset throw probability\n\n");
last1=2;
last2=1;
}
}
printf("After %d throws Average = %.2f%%\n", throwsperlife, (float)((float)(counter*100)/(float)(throwsperlife)));

system("pause");
}

int ham(int last1, int last2)
{
int hammerval=0;
hammerval = 1 + rand()%9;
printf("Threw a %d\n", hammerval);

while( (hammerval==last1 || hammerval==last2) )
{
printf("Can't throw %d or %d, throwing again!\n", last1, last2);
hammerval = 1 + rand()%9;
printf("Threw a %d\n", hammerval);
}

return (int)hammerval;
}

==============
Sample Run
==============
How many lives do you want to test?
4
How many times do you want to test?
3
Threw a 5
Threw a 3
Threw a 4
Threw a 9
Died, reset throw probability

Threw a 8
Threw a 3
Threw a 8
Can't throw 8 or 3, throwing again!
Threw a 9
Died, reset throw probability

Threw a 1
Can't throw 2 or 1, throwing again!
Threw a 8
Threw a 1
Can't throw 1 or 8, throwing again!
Threw a 5
Threw a 4
Threw a 1
Threw a 8
Threw a 1
Can't throw 1 or 8, throwing again!
Threw a 2
Threw a 8
Can't throw 8 or 2, throwing again!
Threw a 4
Threw a 8
Threw a 1
Threw a 3
Threw a 2
Threw a 9
Died, reset throw probability

Threw a 9
Died, reset throw probability

Threw a 8
Threw a 9
Died, reset throw probability

Threw a 7
Threw a 6
Threw a 3
Threw a 9
Died, reset throw probability

Threw a 9
Died, reset throw probability

Threw a 5
Threw a 8
Threw a 7
Threw a 6
Threw a 5
Threw a 3
Threw a 8
Threw a 9
Died, reset throw probability

Threw a 7
Threw a 8
Threw a 8
Can't throw 7 or 8, throwing again!
Threw a 5
Threw a 3
Threw a 9
Died, reset throw probability

Threw a 5
Threw a 7
Threw a 6
Threw a 9
Died, reset throw probability

Threw a 4
Threw a 5
Threw a 7
Threw a 9
Died, reset throw probability

Threw a 1
Can't throw 2 or 1, throwing again!
Threw a 6
Threw a 8
Threw a 4
Threw a 6
Threw a 9
Died, reset throw probability

After 53 throws Average = 22.64%
Press any key to continue . . .
 

SUB Z€R0

Smash Apprentice
Joined
Nov 20, 2007
Messages
121
Location
At my house?
nice work i can't believe you actually did that o.o

but anyway nice that helps my G&W even though he isn't ma main

Edit: Oh btw extremely nice G&W your my favourite player for this char
 

ZorakBane

Smash Journeyman
Joined
Jan 8, 2002
Messages
447
Location
Kalamazoo, MI
nice work i can't believe you actually did that o.o

but anyway nice that helps my G&W even though he isn't ma main

Edit: Oh btw extremely nice G&W your my favourite player for this char
thanks, i cant test out anything from what we know to be true about the hammer.. just need suggestions
 

j00t

Smash Champion
Joined
Jul 16, 2006
Messages
2,194
Location
North AL
Boo. C sucks.

:p

It's admirable to test stuff like this, but we need to know everything about the hammer before we can compile something like this. Even if we did know everything, actually applying it to our real matches at this point is a no-go.
 
Top Bottom