📝 docs(tsl): clarify syntax constraints and enhance test infrastructure
- Add TSF file naming constraint to syntax/02_core_model.md - Clarify semicolon rules: syntax facts vs style preferences - Separate control flow end semicolon rules (syntax allows both) - Add function body semicolon requirements to syntax/05_functions_and_calls.md - Move style preferences to code_style.md (control flow end semicolons) - Remove cross-references from syntax docs to maintain independence - Enhance Gitea workflow emoji for better CI output readability - Fix CI test path from tests/ to test/ - Organize agent test results under test/agent/result/ directory - Add complete Chinese translation of test cases (test_cases_zh.md) - Clean up .gitignore to use unified test/agent/result/ directory - Remove obsolete agent test artifacts (REPORTS_LOCATION.md, old results) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
# 系统相关函数 - 随机函数
|
||||
|
||||
文档类型:函数事实页
|
||||
是否可直接用于生成代码:是;本页函数条目均包含参数表
|
||||
遇到不确定时:回到 [../system.md](../system.md)、[../../index.md](../../index.md)
|
||||
|
||||
## 随机函数
|
||||
|
||||
### `randomize()`
|
||||
|
||||
用途:随机函数相关函数。
|
||||
|
||||
参数个数:0
|
||||
返回值:处理结果
|
||||
|
||||
| 参数位置 | 参数名 | 必填 | 接收类型 | 说明 |
|
||||
| -------- | ------ | ---- | -------- | ---- |
|
||||
|
||||
### `random([value])`
|
||||
|
||||
用途:生成随机数。
|
||||
|
||||
参数个数:0 到 1
|
||||
返回值:随机实数或随机整数
|
||||
|
||||
| 参数位置 | 参数名 | 必填 | 接收类型 | 说明 |
|
||||
| -------- | ------- | ---- | -------- | -------------------- |
|
||||
| 1 | `value` | 否 | 整数 | value 为上限(可选) |
|
||||
|
||||
### `randomFrom(items)`
|
||||
|
||||
用途:从数组中随机取一个元素。
|
||||
|
||||
参数个数:1
|
||||
返回值:随机元素
|
||||
|
||||
| 参数位置 | 参数名 | 必填 | 接收类型 | 说明 |
|
||||
| -------- | ------- | ---- | -------- | -------- |
|
||||
| 1 | `items` | 是 | 数组 | 候选数组 |
|
||||
Reference in New Issue
Block a user