0
votes
4answers
127 views

Random “month & day” with JS ( jQuery )

setInterval(function() { var days_array = [31,29,31,30,31,30,31,31,30,31,30,31]; var m = randNum(12); var m_limit = days_array[m-1]; var d = randNum(m_limit); $("code").html("day = ...
1
vote
3answers
1k views

Randomize a jQuery object list

Well this was a simplest code competition at my work. I tried a couple things, they accepted but none of them is I wanted. Because both are always giving same result. I tried to randomize like this ...
2
votes
1answer
774 views

JavaScript: Weighted Random Generator

I'm attempting to create a function that will give me a "fish" at random, though a bias random depending on the weight value for the "fish". var FISH = { "level1": [ //["name", xp, ...