Skip to content

Instantly share code, notes, and snippets.

@meixg
Created February 8, 2016 17:15
Show Gist options
  • Select an option

  • Save meixg/3ba2f9f6bc60afabb297 to your computer and use it in GitHub Desktop.

Select an option

Save meixg/3ba2f9f6bc60afabb297 to your computer and use it in GitHub Desktop.
var dice = function(){
var num=3;
return function(minimum, maximum){
var t = new Date();
var number = t.getMilliseconds();
number = (number*num)%6/5;
if(num == 0){
num = 3;
}else{
num = number;
}
number = number*(maximum - minimum);
return(number + minimum).toFixed(0);
}
}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment