aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc
diff options
context:
space:
mode:
authorCalvin Rose <calsrose@gmail.com>2022-10-12 14:13:24 -0500
committerCalvin Rose <calsrose@gmail.com>2022-10-12 14:13:24 -0500
commitc37f9b320c8598b890ec44bfcef52e77ec1d2313 (patch)
tree5788c2e8495e2dc6ecd50c8c420a79a72678966a /doc
parentAdd randgen module for executing random branches of code. (diff)
Add randgen doc page.
Diffstat (limited to 'doc')
-rw-r--r--doc/randgen.mdz20
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))
+```