News:

This week IPhone 15 Pro winner is karn
You can be too a winner! Become the top poster of the week and win valuable prizes.  More details are You are not allowed to view links. Register or Login 

Main Menu

Generating weighed random numbers in JavaScript

Started by District_posters, May 22, 2006, 09:03:23 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

passtopassmachine

 Generating weighed random numbers in JavaScript

While it's impossible to forecast the exact occurrence of a random event, even a non-mathematician would agree we can manipulate the likelihood of something occurring. For example, in the case of winning the lottery, that would simply mean buying more tickets (and having your dreams dashed multiple times of course). In this tutorial, we take a stab at generating weighed random numbers, or random numbers with some more likely to show up than others. This is useful in situations where you need a more refined random engine, for example in a banner script that can display some banners more often than others.

READ REST OF TUTORIAL You are not allowed to view links. Register or Login