-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgenerator.lua
More file actions
106 lines (106 loc) · 3.04 KB
/
generator.lua
File metadata and controls
106 lines (106 loc) · 3.04 KB
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
local a = list({}, {_to_null(0, 1, 2, 3)})
local b = coroutine_wrap(function() for _, i in a do coroutine.yield((i + 1)) end end)
local i = 0
for _, n in b do
assert(bool({}, (n == (a[_to_null(i)] + 1))))
i = (i + 1)
::loop_label_1::
end
a = list({}, {_to_null(0, 1, 2, 3)})
b = coroutine_wrap(function() for _, i in a do coroutine.yield(bool({}, ((mod_operator(i, 2)) == 1)) and i or 0) end end)
i = 0
for _, n in b do
if bool({}, (i == 0)) then
assert(bool({}, (n == 0)))
end
if bool({}, (i == 1)) then
assert(bool({}, (n == 1)))
end
if bool({}, (i == 2)) then
assert(bool({}, (n == 0)))
end
if bool({}, (i == 3)) then
assert(bool({}, (n == 3)))
end
i = (i + 1)
::loop_label_2::
end
a = list({}, {_to_null(0, 1, 2, 3)})
b = coroutine_wrap(function() for _, i in a do if bool({}, ((mod_operator(i, 2)) == 1)) then coroutine.yield(i) end end end)
i = 0
for _, n in b do
if bool({}, (i == 0)) then
assert(bool({}, (n == 1)))
end
if bool({}, (i == 1)) then
assert(bool({}, (n == 3)))
end
i = (i + 1)
::loop_label_3::
end
a = list({}, {_to_null(0, 1)})
b = list({}, {_to_null(10, 11)})
local c = coroutine_wrap(function() for _, m in a do for _, n in b do coroutine.yield((n - m)) end end end)
i = 0
for _, n in c do
if bool({}, (i == 0)) then
assert(bool({}, (n == 10)))
end
if bool({}, (i == 1)) then
assert(bool({}, (n == 11)))
end
if bool({}, (i == 2)) then
assert(bool({}, (n == 9)))
end
if bool({}, (i == 3)) then
assert(bool({}, (n == 10)))
end
i = (i + 1)
::loop_label_4::
end
a = list({}, {_to_null(list({}, {_to_null(0, 1)}), list({}, {_to_null(2, 3)}))})
b = coroutine_wrap(function() for _, i in a do for _, j in i do coroutine.yield(j) end end end)
i = 0
for _, n in b do
if bool({}, (i == 0)) then
assert(bool({}, (n == 0)))
end
if bool({}, (i == 1)) then
assert(bool({}, (n == 1)))
end
if bool({}, (i == 2)) then
assert(bool({}, (n == 2)))
end
if bool({}, (i == 3)) then
assert(bool({}, (n == 3)))
end
i = (i + 1)
::loop_label_5::
end
a = list({}, {_to_null(list({}, {_to_null(0, 1, 2)}), list({}, {_to_null(0, 1)}), list({}, {_to_null(0)}))})
b = coroutine_wrap(function() for _, i in a do if bool({}, (len(merge_kwargs({}, {}), i) == 2)) then for _, j in i do if bool({}, (j == 0)) then coroutine.yield(j) end end end end end)
i = 0
for _, n in b do
if bool({}, (i == 0)) then
assert(bool({}, (n == 0)))
end
i = (i + 1)
::loop_label_6::
end
assert(bool({}, (i == 1)))
c = coroutine_wrap(function() for _, i in a do if bool({}, (len(merge_kwargs({}, {}), i) == 2)) then for _, j in i do if bool({}, (j == 0)) then coroutine.yield(bool({}, (j == 1)) and j or 10) end end end end end)
i = 0
for _, n in c do
if bool({}, (i == 0)) then
assert(bool({}, (n == 10)))
end
i = (i + 1)
::loop_label_7::
end
assert(bool({}, (i == 1)))
return {
a = a,
b = b,
i = i,
c = c,
}