mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-12-12 11:12:29 +00:00
chore: initial commit
This commit is contained in:
commit
70b00c5c38
965 changed files with 264882 additions and 0 deletions
13
vendor/lua-5.1.3/test/fibfor.lua
vendored
Normal file
13
vendor/lua-5.1.3/test/fibfor.lua
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
-- example of for with generator functions
|
||||
|
||||
function generatefib (n)
|
||||
return coroutine.wrap(function ()
|
||||
local a,b = 1, 1
|
||||
while a <= n do
|
||||
coroutine.yield(a)
|
||||
a, b = b, a+b
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
for i in generatefib(1000) do print(i) end
|
||||
Loading…
Add table
Add a link
Reference in a new issue