Skip to content

Instantly share code, notes, and snippets.

@no-reply
Last active Dec 12, 2015
Embed
What would you like to do?
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