You're here: Snippet Directory » HTML/JavaScript (65)
Language:

Random Number Generator

Language: English
Programming Language: JavaScript
Published by: pjjt [not registered]
Last Update: 5/15/2006
Views: 532


Description

This is the random number generator I'm using for a web-based touch type toutor application.

Code

1 function randomize(iUpper, iLoops) { 2 for (var i=0, j=0, x=-1; i<iLoops; i++) { 3 j = (new Date()).getMilliseconds() 4 j = Math.round(j/100); 5 if (j < iUpper) { 6 x = j; 7 } 8 } 9 return x; 10 }

No comments avaiable

Add a comment

Name *  

Email (won't be displayed) *    

Website  

Comment *  

Sicherheitscode Security Code *    

RSS