I would guess you'd have to seed random with a call to Math.srandom
(). If you want your widget to behave in a deterministic fashion,
use the same seed every time. If not, you could seed it with part of
the time. Maybe this'll work:
var date = new Date();
Math.srandom(date.getMilliseconds());
-Tom
On Jun 19, 2005, at 7:22 PM, Don McConnell wrote:
Hello ...
Math.random() doesn't seem to get seeded when a widget
is launched.
What's a good alternative random number generator?
Thanks and regards ...
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Dashboard-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/dashboard-dev/tom%
40omnigroup.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Dashboard-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/dashboard-dev/email@hidden