Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A library for generating random numbers based on the Mersenne Twister, a pseudorandom number generating algorithm.
C Lua
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
CMakeLists.txt Updated cmake macros
README build: add CMakeLists.txt and related files
lrandom.c build: add CMakeLists.txt and related files
random.c build: add CMakeLists.txt and related files


This is a random-number library for Lua 5.1. It is based on the Mersenne
Twister random number generator available at

To try the library, just edit Makefile to reflect your installation of Lua and
then run make. This will build the library and run a simple test. For detailed
installation instructions, see

There is no manual but the library is simple and intuitive; see the summary
below. Read also test.lua, which shows the library in action.

This code is hereby placed in the public domain, except random.c, which is
subject to the BSD license.

Please send comments, suggestions, and bug reports to .


random library:
 __call(c) 		 new([seed]) 		 version 
 __tostring(c) 		 seed(c,[seed]) 
 clone(c) 		 value(c,[a,b]) 

Something went wrong with that request. Please try again.