blob: a5b8642925f3ff2e28f2e5d37a9bf5037010d583 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
/* syntax version 1 */
/* yt can not */
$switch = ($x) -> {
$res = case $x
when 0 then 1
when 1 then 2
when 2 then 3
when 3 then 4
when 4 then 5
when 5 then 6
when 6 then 7
when 7 then 8
when 8 then 9
when 9 then 10
when 10 then 11
when 11 then 12
when 12 then 13
when 13 then 14
when 14 then 15
when 15 then 16
when 16 then 17
when 17 then 18
when 18 then 19
when 19 then 20
when 20 then 21
when 21 then 22
when 22 then 23
when 23 then 24
when 24 then 25
when 25 then 26
when 26 then 27
when 27 then 28
when 28 then 29
when 29 then 30
when 30 then 31
when 31 then 32
when 32 then 33
when 33 then 34
when 34 then 35
when 35 then 36
when 36 then 37
when 37 then 38
when 38 then 39
when 39 then 40
when 40 then 41
when 41 then 42
when 42 then 43
when 43 then 44
when 44 then 45
when 45 then 46
when 46 then 47
when 47 then 48
when 48 then 49
when 49 then 50
when 50 then 51
when 51 then 52
when 52 then 53
when 53 then 54
when 54 then 55
when 55 then 56
when 56 then 57
when 57 then 58
when 58 then 59
when 59 then 60
when 60 then 61
when 61 then 62
when 62 then 63
when 63 then 64
when 64 then 65
when 65 then 66
when 66 then 67
when 67 then 68
when 68 then 69
when 69 then 70
when 70 then 71
when 71 then 72
when 72 then 73
when 73 then 74
when 74 then 75
when 75 then 76
when 76 then 77
when 77 then 78
when 78 then 79
when 79 then 80
when 80 then 81
when 81 then 82
when 82 then 83
when 83 then 84
when 84 then 85
when 85 then 86
when 86 then 87
when 87 then 88
when 88 then 89
when 89 then 90
when 90 then 91
when 91 then 92
when 92 then 93
when 93 then 94
when 94 then 95
when 95 then 96
when 96 then 97
when 97 then 98
when 98 then 99
else 100
end;
return $res;
};
$expected = ListFromRange(1, 101);
select ListMap(ListFromRange(0, 100), $switch) == $expected;
|