Skip to content

Instantly share code, notes, and snippets.

@pgib
Created February 25, 2010 18:12
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 pgib/314841 to your computer and use it in GitHub Desktop.
Save pgib/314841 to your computer and use it in GitHub Desktop.
function random(seed)
{
if (!seed)
seed = new Date().getTime();
seed = (seed*9301+49297) % 233280;
return seed/(233280.0);
}
document.write("using random(1): " + random(1));
document.write("<br>");
document.write("using Math.random(): " + Math.random());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment