Words and universal macOS installer

This commit is contained in:
2026-02-06 00:37:08 +01:00
parent 3c518e4c5a
commit f1af4d2cdb
7 changed files with 232 additions and 2 deletions

View File

@@ -66,6 +66,8 @@ pub(super) fn simple_op(name: &str) -> Option<Op> {
"cycle" => Op::Cycle,
"pcycle" => Op::PCycle,
"choose" => Op::Choose,
"bounce" => Op::Bounce,
"wchoose" => Op::WChoose,
"every" => Op::Every,
"chance" => Op::ChanceExec,
"prob" => Op::ProbExec,

View File

@@ -103,6 +103,26 @@ pub(super) const WORDS: &[Word] = &[
compile: Simple,
varargs: true,
},
Word {
name: "bounce",
aliases: &[],
category: "Probability",
stack: "(v1..vn n -- selected)",
desc: "Ping-pong cycle through n items by step runs",
example: "60 64 67 72 4 bounce",
compile: Simple,
varargs: true,
},
Word {
name: "wchoose",
aliases: &[],
category: "Probability",
stack: "(v1 w1 v2 w2 ... n -- selected)",
desc: "Weighted random pick from n value/weight pairs",
example: "60 0.6 64 0.3 67 0.1 3 wchoose",
compile: Simple,
varargs: true,
},
Word {
name: "always",
aliases: &[],