Changes

Jump to navigation Jump to search
123 bytes removed ,  15:15, 8 June 2020
m
no edit summary
This page describes how to use random (to produce pseudo-random values) in ConTeXt and MetaPost. The `uniformdeviate` function in MetaPost, by default, uses a seeded value. This is useful to generate the "same" random results each time the final product is generated, but hampers creating books that differ from each other on successive generations.
A number of related commands include:See the {{cmd|getrandomnumber}} command for details.
* {{cmd|getrandomnumber}} - Generates a pseudo-The random number seed is stored in the `tuc` file so that you get the same output each time.* {{cmd|ctxlua}}<tt>{math.randomseedthe file is compiled (osotherwise, multiple compiles can lead to an infinite cycle and you may not get all the references correct).time())}</tt> - Sets the seed based on Another approach is to delete the computer's timestamptuc file between runs.
The random seed is stored in the `tuc` file so that you get the same output each time the file is compiled (otherwise, multiple compiles can lead to an infinite cycle [[Category:Programming and you may not get all the references correct). Another approach is to delete the tuc file between runs.Databases]]

Navigation menu