Files
playbook/docs/tsl/reference/catalog/system/05_random.md
T
csh 540b3c0a1b 📝 docs(tsl): restructure agent-facing reference
Rework TSL syntax, catalog, modules, and routing docs around deterministic agent lookup and generation.

Split large catalog pages into focused function fact pages, remove obsolete pending/verified/unavailable paths, and update consistency tests for the new structure.
2026-06-09 17:24:30 +08:00

1.1 KiB

系统相关函数 - 随机函数

文档类型:函数事实页 是否可直接用于生成代码:是;本页函数条目均包含参数表 遇到不确定时:回到 ../system.md../../index.md

随机函数

randomize()

用途:随机函数相关函数。

参数个数:0 返回值:处理结果

参数位置 参数名 必填 接收类型 说明

random([value])

用途:生成随机数。

参数个数:0 到 1 返回值:随机实数或随机整数

参数位置 参数名 必填 接收类型 说明
1 value 整数 value 为上限(可选)

randomFrom(items)

用途:从数组中随机取一个元素。

参数个数:1 返回值:随机元素

参数位置 参数名 必填 接收类型 说明
1 items 数组 候选数组