Flip a Coin 10000 Times!
This program will flip a coin as many times as your computer can handle and tell you how many times you get heads or tails.
Edit: lol how did this lame program get 7 13 up-votes
Edit 2: Y'all made me self conscious about my code so I updated it, making the program better.
Edit 3: Also, please don't crucify me, I'm too lazy to style the program.
Also, as @TheDrone7 mentioned, the results are somewhat biased, because the JavaScript Math.random function is given a seed such that the random number is almost always going to be very near to 0.5
. So sorry about that, I couldn't think of a way to fix it.
Use input type=number so that people can't input letters.
This app is very interesting to use
Fun fact, the js Math random function is given a seed such that the random number is almost always going to be very near to 0.5
Cool
@Yoplayer1py Thanks!
This is so simple and so interesting lol
@CoderGautamYT thank you :)
Nice, I've made some changes - https://coin-flipping-statistics.sn236.repl.co/. (As it was plain)
@sn236 @STCollier I made one as well. This one has a couple new things.
- You really overcomplicated the code... it wont go higher than 10K. I made it go all the way up as high as you want (I have it currently set at 100 Million... no higher bc of lag). I also added a stylesheet. Mine also calculates the ratio of heads to tails to make it easily readable how close it is to even.
ya. loops are a lot better because you can go through them as many times as you want. @STCollier
Cool