docs: adopt complete-reader RFC and freeze the RC.2 fixture

This commit is contained in:
cflmy committed 2026-11-24 13:05:08 +08:00
1 parent dcb9daeaf4
commit 27532e7b4c
12 files changed
+863

No files matched your search

@@ -0,0 +1,13 @@
# @knowledge 误差说明
## 误差
[返回计算均值](../index.mq.md#计算均值)
![样本记录](../media/result.webp)
## 误差
同名标题以稳定的序号区分。
![流程图](../media/diagram.svg)
+95
View File
@@ -0,0 +1,95 @@
# @knowledge 小型统计实验
样本的均值 $\\bar{x}$ 可用下式计算:
$$
\\bar{x} = \\frac{1}{n} \\sum_{i=1}^{n} x_i
$$
![样本数据图](media/flow.png)
| 样本 | 数值 |
| :--- | ---: |
| A | 3 |
| B | 5 |
- [x] 记录样本
- [ ] 审查结果
[误差说明](docs/explanation.mq.md#误差-1) · [本页公式](#计算均值)
# @exec 计算
## @exec main
`return 4`
## @exec 计算均值
计算两个样本的均值。
`params(a: Int, b: Int = 5)`
`return (a + b) / 2`
## @exec classify
`params(n: Int)`
**if n < 0**
`return -1`
**else if n == 0**
`return 0`
**else**
`return 1`
**end**
## @exec scan
`n = 0`
**while n < 10**
`n = n + 1`
**if n == 2**
`continue`
**else if n == 4**
`break`
**end**
**end**
`return n`
## @exec fail
`params(divisor: Int)`
`return 3 / divisor`
## @exec write_output
`buffer = memory.new(1, 1)`
`buffer[0] = 52`
`buffer[1] = 10`
`stdout = resource.open("stdio", "stdout", ["write"])`
`resource.write(stdout, buffer, 0, 2)`
`resource.close(stdout)`
`return 4`
+3
View File
@@ -0,0 +1,3 @@
project:
name: complete-reader
version: 0.1.0
+1
View File
@@ -0,0 +1 @@
PNG、WebP 和 SVG 均为本仓库原创合成测试图,适用仓库的 MIT/Apache-2.0 双许可。
@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="360" height="80" viewBox="0 0 360 80">
<rect x="1" y="1" width="358" height="78" rx="8" fill="#f7f0e5" stroke="#b88a45"/>
<path d="M48 40h264m-12-9 12 9-12 9" fill="none" stroke="#52603a" stroke-width="2"/>
<circle cx="80" cy="40" r="7" fill="#52603a"/>
<circle cx="200" cy="40" r="7" fill="#52603a"/>
</svg>

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 B