< index
< 8. All purposes container

=====================================
9. Pseudorandom number generator
=====================================

> 10. Noise generator
This toolkit is an implementation of two fast and high quality pseudorandom number generators:

CMWC is faster than MT (see table below) and has a much better period (1039460 vs. 106001). It is the default algo since libtcod 1.5.0.
Relative performances in two independent tests:

AlgorithmNumbers generatedPerf (1)Perf (2)
MTinteger6250
MTfloat5445
CMWCinteger2134
CMWCfloat3227

For python users :
Python already has great builtin random generators. But some parts of the Doryen library (noise, heightmap, ...) uses RNG as parameters. If you intend to use those functions, you must provide a RNG created with the library.

9.1 Creating a generator
9.2 Using a generator
9.3 Destroying a generator