Click "Click For Rarity" to calculate 1 in 10 thousand. Please tell me if the code needs to be corrected!
(#10k is number of times 10,000 was chosen) For those who don't understand; This code uses the process of elimination to find a number 1 in 10,000. When you press on the turquoise button in the center the code will pick a random number by using variables to see if the number is not 10,000, which is represented by the 0 on the number line. This means that the number chosen was less than 10,000, so it is automatically eliminated, next goes to 1 in 10,000, which is the same rarity and percentage just on the opposite end of the number line. Think of these two numbers as 9,999 and 1. If the number chosen by the generator is in that range, it moves on to the next question; is the number less than 1,000? This is a 10% chance and it will be represented by the variable "1 in". For example, it will say 1 in 10 because that is the theoretical probability that is. If your number is more rare than a 1 in 10, than the code will check if it's more rare than 1 in 11, 20, 25, 30, 40, 50, 66, 100, 125, 285, 1000, and finally 10,000 which again will be represented by 15 on the number line. TO FINE HOW LUCKY YOUR GAME IS: DIVIDE THE NUMBER OF TIMES YOU CLICKED THE RUN RARITY BY THE RAREST CLICK OR BY "#1k score X 1000" OR "#10k score X 10000". YOUR SCORE SHOULD BE 1, AND IF IT ISN'T, THE FURTHER THE SCORE IS FROM 1, THE MORE RARE THE GAME ROUND IS. The simulation will also keep track of your rarest number. If you are having trouble understanding, comment or look at the code if that helps. And please tell me if the code is wrong! Below are the conversions from the variables 1) 1 in 1.0001 = 9,999 in 10,000 2) 1 in 1.25 = 8,000 in 10,000 3) 1 in 10 = 1,000 in 10,000 4) 1 in 11 = (not exactly) 900 in 10,000 5) 1 in 20 = 500 in 10,000 6) 1 in 25 = 400 in 10,000 7) 1 in 30 = (not exactly) 333 in 10,000 8) 1 in 40 = 250 in 10,000 9) 1 in 50 = 200 in 10,000 10) 1 in 66 = 150 in 10,000 11) 1 in 100 = 100 in 10,000 12) 1 in 125 = 80 in 10,000 13) 1 in 285 = 35 in 10,000 14) 1 in 1,000 = 10 in 10,000 15) 1 in 10,000 = 1 in 10,000 0) Not 9,999 in 10,000 = 1 in 10,000