chance.lua
chance.lua copied to clipboard
Library for Generating Random Data
Chance - Library For Generating Random Data
Chance is a Lua port of Chance.js, a library for generating
random data for a variety of situations. However, it is not a perfect
port as it does not support the entire API of the original and not all
functions behave the same way, e.g. the Lua function chance.float()
returns numbers in a different range than the original library’s
chance.floating().
Requirements
Chance requires Lua 5.1 or later, or LuaJIT 2.0 or later.
Usage
Simply place chance.lua somewhere in the package path where
require() can find it, and then use the library like so:
local chance = require("chance")
Running LDoc on chance.lua will create a doc/ directory with
detailed information on the library’s API.
That documentation is also available online.
If Tup is available then running tup within the project
directory will…
- Run LDoc to create documentation.
- Test for any errors in the code via Luacheck.
- Run the test suite in
chance.spec.luavia Busted. Output will go into the file/tmp/chance-busted.log. - Create a
TAGSfile for Emacs via Exuberant Ctags.
Tup and all other tools mentioned above are optional and not required to use the Chance library.
License
Copyright 2015 Plutono Inc.
GNU General Public License 3
Miscellaneous
This project follows Semantic Versioning.