diff options
Diffstat (limited to 'spec/inputs/unicode/goto.yue')
-rw-r--r-- | spec/inputs/unicode/goto.yue | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/spec/inputs/unicode/goto.yue b/spec/inputs/unicode/goto.yue new file mode 100644 index 0000000..8cba358 --- /dev/null +++ b/spec/inputs/unicode/goto.yue | |||
@@ -0,0 +1,41 @@ | |||
1 | do | ||
2 | 变量a = 0 | ||
3 | ::开始:: | ||
4 | 变量a += 1 | ||
5 | goto 结束 if 变量a == 5 | ||
6 | goto 开始 | ||
7 | ::结束:: | ||
8 | |||
9 | do | ||
10 | for 计数z = 1, 10 do for 计数y = 1, 10 do for 计数x = 1, 10 | ||
11 | if 计数x^2 + 计数y^2 == 计数z^2 | ||
12 | 打印 '找到了毕达哥拉斯三元组:', 计数x, 计数y, 计数z | ||
13 | goto 完成 | ||
14 | ::完成:: | ||
15 | |||
16 | do | ||
17 | for 计数z = 1, 10 | ||
18 | for 计数y = 1, 10 do for 计数x = 1, 10 | ||
19 | if 计数x^2 + 计数y^2 == 计数z^2 | ||
20 | 打印 '找到了毕达哥拉斯三元组:', 计数x, 计数y, 计数z | ||
21 | 打印 'now trying next z...' | ||
22 | goto 继续z | ||
23 | ::继续z:: | ||
24 | |||
25 | do | ||
26 | ::重做:: | ||
27 | for 计数x = 1, 10 do for 计数y = 1, 10 | ||
28 | if not 函数f 计数x, 计数y then goto 继续 | ||
29 | if not 函数g 计数x, 计数y then goto 跳过 | ||
30 | if not 函数h 计数x, 计数y then goto 重做 | ||
31 | ::继续:: | ||
32 | ::跳过:: | ||
33 | |||
34 | do | ||
35 | for 变量 in *列表 | ||
36 | if 变量 % 2 == 0 | ||
37 | 打印 '列表有偶数' | ||
38 | goto 有 | ||
39 | 打印 '列表没偶数' | ||
40 | ::有:: | ||
41 | |||