Several helper functions for improved random number generation
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
Victor Giers 9573d787c6 added animation to readme pirms 1 gada
README.md added animation to readme pirms 1 gada
curveprobability.gif added everything, wrote readme, made an animation pirms 1 gada
improved_rng.pde added everything, wrote readme, made an animation pirms 1 gada

README.md

Improved Random Number Generator

These are some methods for generating randomness.
There is:

  • A plain copy of processings random() function which is just as fast
  • A simple array shuffler
  • An integer-RNG which doesn’t produce the same number twice in a row
  • A method to return a random entry of an array of arbitrary data-type with probability weights (not using Alias)
  • A sophisticated RNG to return a random float between 0 and 1 with its selection weighted by a given probability curve defined by vectors

The last part is the coolest, but also very esoteric and WIP.
This animation shows its function:
Probability Curves