Last active
December 12, 2015 07:08
-
-
Save no-reply/4734774 to your computer and use it in GitHub Desktop.
OnlineNW Lotto Name Picker
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 count = 0; | |
var interId = 0; | |
function lotto() { | |
clearInterval(interId); | |
interId = setInterval("choosename()", 80); | |
count = 0; | |
} | |
function choosename(names) { | |
var names = new Array("Anand", | |
"Bess", | |
"Cory", | |
"Darlene", | |
"Edmund", | |
"Felicia", | |
"George", | |
"Heather", | |
"Isaac", | |
"Jessica", | |
"Kim", | |
"Leigh"); | |
var rnum = Math.random() * names.length; | |
document.getElementById("winner").innerHTML = names[Math.floor(rnum)]; | |
if (count == 38) { | |
clearInterval(interId); | |
document.getElementById("winner").innerHTML = names[Math.floor(rnum)] + "!"; | |
} | |
count = count + 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment