LucyDuke
staring at the clock
Okay, so I'm building a website for somebody, and I have a feature in mind that exceeds my (limited) JavaScript skills.
I need two things.
One - I need to define a variable as a number based on the year, month, and day. So the number needs to be the same all day, and a different number the next day, and a different number the following day, and so on. It shouldn't repeat each year. I know how to define a variable as a string of the date, but not as a number from the date. It needs to be a number so it can feed into...
Two - I need to use that variable to seed a "random" number between 1 and 100. I can't use the regular built-in RNG because this number needs to be consistent all day, too, and change every day. It can't be the same as the date number, though, it needs to be kind of randomized. I figure I can just use some erratic equation, but maybe somebody's got a good one already.
Can anybody help?
EDIT: I've got the date part figured out. Now all I need is a good PRNG equation.
I need two things.
One - I need to define a variable as a number based on the year, month, and day. So the number needs to be the same all day, and a different number the next day, and a different number the following day, and so on. It shouldn't repeat each year. I know how to define a variable as a string of the date, but not as a number from the date. It needs to be a number so it can feed into...
Two - I need to use that variable to seed a "random" number between 1 and 100. I can't use the regular built-in RNG because this number needs to be consistent all day, too, and change every day. It can't be the same as the date number, though, it needs to be kind of randomized. I figure I can just use some erratic equation, but maybe somebody's got a good one already.
Can anybody help?

EDIT: I've got the date part figured out. Now all I need is a good PRNG equation.