diff options
| author | 2022-10-12 14:13:24 -0500 | |
|---|---|---|
| committer | 2022-10-12 14:13:24 -0500 | |
| commit | c37f9b320c8598b890ec44bfcef52e77ec1d2313 (patch) | |
| tree | 5788c2e8495e2dc6ecd50c8c420a79a72678966a /doc | |
| parent | Add randgen module for executing random branches of code. (diff) | |
Add randgen doc page.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/randgen.mdz | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/randgen.mdz b/doc/randgen.mdz new file mode 100644 index 0000000..046118f --- /dev/null +++ b/doc/randgen.mdz @@ -0,0 +1,20 @@ +{:title "Randgen" + :author "Calvin Rose" + :license "MIT" + :template "mdzdoc/main.html" + :order 5} +--- + +A small utility for random number generation, especially with a focus on +discrete numbers. The most powerful idea here is the ability to have branches +that execute probabalistically - i.e. one branch is taken half the time +randomly, and another is taken otherwise. + +@codeblock[janet]``` +# Print either a, b, or c +(import spork/randgen) +(randgen/rand-path + (print "a") + (print "b") + (print "c)) +``` |
