<script> var item = prompt("Item? Enter nothing to stop", ""); var arr = new Array(); while( item != "" ){ arr.push( item ); item = prompt("Item? Enter nothing to stop", ""); } do { var rand = Math.random(); rand = rand * arr.length; var conf = confirm("A rand item out of " + arr.length + " items :\n\n" + arr[((Math.floor(rand)%arr.length))] + "\n\nAnother?"); } while( conf ) </script>
JNighthawk wrote: » Homework?
Posts
Stick that code in an HTML file. Reload when you want a new set.
It'll also randomly delete your harddrive, for extra fun.
Didn't look like a homework question, otherwise I wouldn't have bothered with code.
If it is, then it's a really bad question, even for cheating.
http://decider.skizzers.org/