2011-05-28 04:27:59 +00:00
|
|
|
local hi = (function()
|
2011-07-14 07:02:07 +00:00
|
|
|
local _accum_0 = { }
|
2011-05-28 04:27:59 +00:00
|
|
|
for _, x in ipairs({
|
2011-06-23 15:42:43 +00:00
|
|
|
1,
|
|
|
|
2,
|
|
|
|
3,
|
|
|
|
4
|
|
|
|
}) do
|
2011-07-14 07:02:07 +00:00
|
|
|
table.insert(_accum_0, x * 2)
|
2011-05-28 04:27:59 +00:00
|
|
|
end
|
2011-07-14 07:02:07 +00:00
|
|
|
return _accum_0
|
2011-05-28 04:27:59 +00:00
|
|
|
end)()
|
|
|
|
local items = {
|
|
|
|
1,
|
|
|
|
2,
|
|
|
|
3,
|
|
|
|
4,
|
|
|
|
5,
|
|
|
|
6
|
|
|
|
}
|
|
|
|
local mm = (function()
|
2011-07-14 07:02:07 +00:00
|
|
|
local _accum_0 = { }
|
2011-05-28 04:27:59 +00:00
|
|
|
for self.x in ipairs(items) do
|
2011-07-14 07:02:07 +00:00
|
|
|
table.insert(_accum_0, self.x)
|
2011-05-28 04:27:59 +00:00
|
|
|
end
|
2011-07-14 07:02:07 +00:00
|
|
|
return _accum_0
|
2011-05-28 04:27:59 +00:00
|
|
|
end)()
|
2011-05-29 21:40:40 +00:00
|
|
|
for z in ipairs(items) do
|
|
|
|
if z > 4 then
|
|
|
|
local _ = z
|
|
|
|
end
|
|
|
|
end
|
2011-05-28 04:27:59 +00:00
|
|
|
local rad = (function()
|
2011-07-14 07:02:07 +00:00
|
|
|
local _accum_0 = { }
|
2011-05-28 04:27:59 +00:00
|
|
|
for a in ipairs({
|
2011-06-23 15:42:43 +00:00
|
|
|
1,
|
|
|
|
2,
|
|
|
|
3,
|
|
|
|
4,
|
|
|
|
5,
|
|
|
|
6
|
|
|
|
}) do
|
2011-05-28 04:27:59 +00:00
|
|
|
if good_number(a) then
|
2011-07-14 07:02:07 +00:00
|
|
|
table.insert(_accum_0, {
|
|
|
|
a
|
|
|
|
})
|
2011-05-28 04:27:59 +00:00
|
|
|
end
|
|
|
|
end
|
2011-07-14 07:02:07 +00:00
|
|
|
return _accum_0
|
2011-05-29 21:40:40 +00:00
|
|
|
end)()
|
|
|
|
for z in items do
|
|
|
|
for j in list do
|
|
|
|
if z > 4 then
|
2011-06-13 05:38:42 +00:00
|
|
|
local _ = z
|
2011-05-28 06:21:29 +00:00
|
|
|
end
|
|
|
|
end
|
2011-05-29 21:40:40 +00:00
|
|
|
end
|
2011-05-28 06:21:29 +00:00
|
|
|
require("util")
|
2011-06-03 03:55:33 +00:00
|
|
|
local dump
|
2011-07-14 07:02:07 +00:00
|
|
|
dump = function(x)
|
|
|
|
return print(util.dump(x))
|
|
|
|
end
|
2011-06-03 03:55:33 +00:00
|
|
|
local range
|
|
|
|
range = function(count)
|
2011-05-28 06:21:29 +00:00
|
|
|
local i = 0
|
2011-06-13 05:38:42 +00:00
|
|
|
return coroutine.wrap(function()
|
2011-05-28 23:45:59 +00:00
|
|
|
while i < count do
|
|
|
|
coroutine.yield(i)
|
|
|
|
i = i + 1
|
|
|
|
end
|
2011-06-13 05:38:42 +00:00
|
|
|
end)
|
2011-05-28 06:21:29 +00:00
|
|
|
end
|
|
|
|
dump((function()
|
2011-07-14 07:02:07 +00:00
|
|
|
local _accum_0 = { }
|
2011-05-28 06:21:29 +00:00
|
|
|
for x in range(10) do
|
2011-07-14 07:02:07 +00:00
|
|
|
table.insert(_accum_0, x)
|
2011-05-28 06:21:29 +00:00
|
|
|
end
|
2011-07-14 07:02:07 +00:00
|
|
|
return _accum_0
|
2011-05-28 06:21:29 +00:00
|
|
|
end)())
|
|
|
|
dump((function()
|
2011-07-14 07:02:07 +00:00
|
|
|
local _accum_0 = { }
|
2011-05-28 06:21:29 +00:00
|
|
|
for x in range(5) do
|
|
|
|
if x > 2 then
|
|
|
|
for y in range(5) do
|
2011-07-14 07:02:07 +00:00
|
|
|
table.insert(_accum_0, {
|
|
|
|
x,
|
|
|
|
y
|
|
|
|
})
|
2011-05-28 06:21:29 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2011-07-14 07:02:07 +00:00
|
|
|
return _accum_0
|
2011-05-28 06:21:29 +00:00
|
|
|
end)())
|
|
|
|
local things = (function()
|
2011-07-14 07:02:07 +00:00
|
|
|
local _accum_0 = { }
|
2011-05-28 06:21:29 +00:00
|
|
|
for x in range(10) do
|
|
|
|
if x > 5 then
|
|
|
|
for y in range(10) do
|
|
|
|
if y > 7 then
|
2011-07-14 07:02:07 +00:00
|
|
|
table.insert(_accum_0, x + y)
|
2011-05-28 06:21:29 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2011-07-14 07:02:07 +00:00
|
|
|
return _accum_0
|
2011-05-29 21:40:40 +00:00
|
|
|
end)()
|
2011-07-14 07:02:07 +00:00
|
|
|
for x in ipairs({
|
|
|
|
1,
|
|
|
|
2,
|
|
|
|
4
|
|
|
|
}) do
|
|
|
|
for y in ipairs({
|
|
|
|
1,
|
|
|
|
2,
|
|
|
|
3
|
|
|
|
}) do
|
2011-05-29 21:40:40 +00:00
|
|
|
if x ~= 2 then
|
|
|
|
print(x, y)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
for x in items do
|
|
|
|
print("hello", x)
|
|
|
|
end
|
|
|
|
for x in x do
|
2011-06-13 05:38:42 +00:00
|
|
|
local _ = x
|
2011-05-29 21:40:40 +00:00
|
|
|
end
|
|
|
|
local x = (function()
|
2011-07-14 07:02:07 +00:00
|
|
|
local _accum_0 = { }
|
2011-05-29 21:40:40 +00:00
|
|
|
for x in x do
|
2011-07-14 07:02:07 +00:00
|
|
|
table.insert(_accum_0, x)
|
2011-05-29 21:40:40 +00:00
|
|
|
end
|
2011-07-14 07:02:07 +00:00
|
|
|
return _accum_0
|
2011-05-29 21:40:40 +00:00
|
|
|
end)()
|
2011-07-14 07:02:07 +00:00
|
|
|
for x in ipairs({
|
|
|
|
1,
|
|
|
|
2,
|
|
|
|
4
|
|
|
|
}) do
|
|
|
|
for y in ipairs({
|
|
|
|
1,
|
|
|
|
2,
|
|
|
|
3
|
|
|
|
}) do
|
2011-05-29 21:40:40 +00:00
|
|
|
if x ~= 2 then
|
|
|
|
print(x, y)
|
|
|
|
end
|
|
|
|
end
|
2011-06-02 03:58:17 +00:00
|
|
|
end
|
|
|
|
local double = (function()
|
2011-07-14 07:02:07 +00:00
|
|
|
local _accum_0 = { }
|
|
|
|
do
|
|
|
|
local _item_0 = items
|
|
|
|
for _index_0 = 1, #_item_0 do
|
2011-07-15 06:25:30 +00:00
|
|
|
local x = _item_0[_index_0]
|
2011-07-14 07:02:07 +00:00
|
|
|
table.insert(_accum_0, x * 2)
|
|
|
|
end
|
2011-06-02 03:58:17 +00:00
|
|
|
end
|
2011-07-14 07:02:07 +00:00
|
|
|
return _accum_0
|
2011-06-02 03:58:17 +00:00
|
|
|
end)()
|
2011-07-14 07:02:07 +00:00
|
|
|
do
|
|
|
|
local _item_0 = double
|
|
|
|
for _index_0 = 1, #_item_0 do
|
2011-07-15 06:25:30 +00:00
|
|
|
local x = _item_0[_index_0]
|
2011-07-14 07:02:07 +00:00
|
|
|
print(x)
|
|
|
|
end
|
2011-06-02 03:58:17 +00:00
|
|
|
end
|
|
|
|
local cut = (function()
|
2011-07-14 07:02:07 +00:00
|
|
|
local _accum_0 = { }
|
|
|
|
do
|
|
|
|
local _item_0 = items
|
|
|
|
for _index_0 = 1, #_item_0 do
|
2011-07-15 06:25:30 +00:00
|
|
|
local x = _item_0[_index_0]
|
2011-07-14 07:02:07 +00:00
|
|
|
if x > 3 then
|
|
|
|
table.insert(_accum_0, x)
|
|
|
|
end
|
2011-06-02 03:58:17 +00:00
|
|
|
end
|
|
|
|
end
|
2011-07-14 07:02:07 +00:00
|
|
|
return _accum_0
|
2011-06-02 03:58:17 +00:00
|
|
|
end)()
|
|
|
|
local hello = (function()
|
2011-07-14 07:02:07 +00:00
|
|
|
local _accum_0 = { }
|
|
|
|
do
|
2011-06-13 05:38:42 +00:00
|
|
|
local _item_0 = items
|
2011-07-14 07:02:07 +00:00
|
|
|
for _index_0 = 1, #_item_0 do
|
2011-07-15 06:25:30 +00:00
|
|
|
local x = _item_0[_index_0]
|
2011-07-14 07:02:07 +00:00
|
|
|
do
|
|
|
|
local _item_1 = items
|
|
|
|
for _index_1 = 1, #_item_1 do
|
|
|
|
local y = _item_1[_index_1]
|
|
|
|
table.insert(_accum_0, x + y)
|
|
|
|
end
|
|
|
|
end
|
2011-06-02 03:58:17 +00:00
|
|
|
end
|
|
|
|
end
|
2011-07-14 07:02:07 +00:00
|
|
|
return _accum_0
|
2011-06-02 03:58:17 +00:00
|
|
|
end)()
|
2011-07-14 07:02:07 +00:00
|
|
|
do
|
|
|
|
local _item_0 = hello
|
|
|
|
for _index_0 = 1, #_item_0 do
|
|
|
|
local z = _item_0[_index_0]
|
|
|
|
print(z)
|
|
|
|
end
|
2011-06-23 15:42:43 +00:00
|
|
|
end
|
|
|
|
x = {
|
|
|
|
1,
|
|
|
|
2,
|
|
|
|
3,
|
|
|
|
4,
|
|
|
|
5,
|
|
|
|
6,
|
|
|
|
7
|
|
|
|
}
|
2011-07-14 07:02:07 +00:00
|
|
|
do
|
|
|
|
local _max_0 = -5
|
|
|
|
local _item_0 = x
|
|
|
|
for _index_0 = 2, _max_0 < 0 and #_item_0 + _max_0 or _max_0, 2 do
|
|
|
|
local y = _item_0[_index_0]
|
|
|
|
print(y)
|
|
|
|
end
|
2011-06-23 15:42:43 +00:00
|
|
|
end
|
2011-07-14 07:02:07 +00:00
|
|
|
do
|
|
|
|
local _max_0 = 3
|
|
|
|
local _item_0 = x
|
|
|
|
for _index_0 = 1, _max_0 < 0 and #_item_0 + _max_0 or _max_0 do
|
|
|
|
local y = _item_0[_index_0]
|
|
|
|
print(y)
|
|
|
|
end
|
2011-06-23 15:42:43 +00:00
|
|
|
end
|
2011-07-14 07:02:07 +00:00
|
|
|
do
|
|
|
|
local _item_0 = x
|
|
|
|
for _index_0 = 2, #_item_0 do
|
|
|
|
local y = _item_0[_index_0]
|
|
|
|
print(y)
|
|
|
|
end
|
2011-06-23 15:42:43 +00:00
|
|
|
end
|
2011-07-14 07:02:07 +00:00
|
|
|
do
|
|
|
|
local _item_0 = x
|
|
|
|
for _index_0 = 1, #_item_0, 2 do
|
|
|
|
local y = _item_0[_index_0]
|
|
|
|
print(y)
|
|
|
|
end
|
2011-06-23 15:42:43 +00:00
|
|
|
end
|
2011-07-14 07:02:07 +00:00
|
|
|
do
|
|
|
|
local _item_0 = x
|
|
|
|
for _index_0 = 2, #_item_0, 2 do
|
|
|
|
local y = _item_0[_index_0]
|
|
|
|
print(y)
|
|
|
|
end
|
2011-05-29 21:40:40 +00:00
|
|
|
end
|