ready.
Quick chars — click to insert at cursor (also copies)
Statements
x <- exprsample from expr into x
(a, b) <- exprtwo independent draws
(a < b) <- exprchain constraint: < ≤ > ≥ ≠
a[N<] <- exprarray of N; suffix < ≤ > ≥ ≠
x = exprassign (eager)
where: condreject draw if false
"tmpl" exproutput; pair: "t1" e1 | "t2" e2
Sampler expressions
{a..b}uniform int; also {a..b step k}
{v1, v2, …}uniform pick; weighted: {v1:w1, v2:w2}
pick(list)sampler over a realized list
Brackets: {} = unrealized sampler, [] = realized list. Scalar op sampler broadcasts.
Predef family — _x(k)
_n(k)k-digit uniform (10^(k−1)..10^k−1)
_n0(k)0..10^k−1
_n1(k)1..10^k−1
_n19(k)each digit 1..9 (no zero)
_n29(k)each digit 2..9
_n28(k)each digit 2..8
_ne(k)k-digit even
_no(k)k-digit odd
_n0e(k)even in 0..10^k−1
_n19e(k)no-zero + even
_n19o(k)no-zero + odd
_n00(k)d·10^i, one nonzero digit (3, 50, 200…)
_dr(k)k-digit repdigit (11, 22, 333…)
Predef fixed
_d00..9
_d11..9
_dd10..99
_dd00..99
_dd11..99
_dpprime digits {2,3,5,7}
_ddp2-digit primes
_b{0, 1}
_sign{−1, +1}
_neg1−9..−1
_neg_dd−99..−10
_10n{10, 100, 1k, 10k}
_pow2 _sq _cupowers of 2 / squares / cubes 1..9
_frac_s _frac_csimple / common unit fractions
_frac_genrandom proper fraction n/d
_dec1 _dec20.1..0.9 / 0.10..0.99
Expressions
^ (right) → unary − → * / % // → + − → == != < <= > >= → not → and → or → if c then a else b. Index: list[k].
Template — text
"{expr}" interpolates. Escape with \{ \}. Nested double quotes: \". Sampler-typed value → rejection.
Template — math (KaTeX)
$…$ is a math block. Inside: single { } render as literal LaTeX braces; {{expr}} = interpolation (wrapped in {}). Literal $: \$. Example: "$\sqrt{{n}}$" n.
Env (read-only)
LEVEL (int ≥1, +1 every 5 correct), WORLD (1..6).
STDLIB
range(lo,hi[,step]) rep rep_join join sum len pick · abs sign sqrt round floor ceil min max sq cube gcd · sup(n) sub(n) frac(n,d) fracHTML(n,d).
Notes
Sampler op sampler → rejection (sample one first). _dec* may render like 0.7000…1 — build template from integer part.