Skip to content

Instantly share code, notes, and snippets.

@no-reply
Last active December 12, 2015 07:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save no-reply/4734774 to your computer and use it in GitHub Desktop.
Save no-reply/4734774 to your computer and use it in GitHub Desktop.
OnlineNW Lotto Name Picker
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