Created
April 23, 2009 18:27
-
-
Save charliemaffitt/100664 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var rand = Math.floor(Math.random()*index); // generate the random number | |
var rand2 = Math.floor(Math.random()*index); // generate the second random number | |
if (rand == rand2) { | |
var rand2 = Math.floor(Math.random()*index); // generate another random number | |
} | |
if (rand == rand2) { | |
var rand2 = Math.floor(Math.random()*index); // generate another random number (this raises the chance of duplicate entries to 1/64) | |
} | |
if (rand == rand2) { | |
var rand2 = Math.floor(Math.random()*index); // generate another random number (this raises the chance of duplicate entries to 1/512) | |
} | |
if (rand == rand2) { | |
var rand2 = Math.floor(Math.random()*index); // generate another random number (this raises the chance of duplicate entries to 1/4096) | |
} | |
var quote = quote_array[rand]; // get the first quote from the array | |
var quote2 = quote_array[rand2]; // get the second quote from the array |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment