Difference between revisions of "RandomLua"

(Adding keyword.)
m (Added: Other Languages)
 
Line 17: Line 17:
 
{{#set:Keyword=Math}}
 
{{#set:Keyword=Math}}
 
[[Category:Libraries]]
 
[[Category:Libraries]]
 +
== Other Languages ==
 +
{{i18n|RandomLua}}

Latest revision as of 15:36, 15 December 2019

math.random used to give different numbers on different platforms. Since I didn't intend to compile C code for every platform, I decided to create a Pure Lua Random Generator (probably another one...).

This is not true anymore, but the library still remains for the curious and those who want to try different pseudo-random generators.

3 algorithms:

  • Mersenne twister [1], very good and slow.
  • Multiply-with-carry [2], probably the best option.
  • Linear congruential generator [3], fast and, well, it works... kind of.

MWC and LCG come with 3 pre-defined parameters.

Original Thread Download

Other Languages