FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
lua/test/fibfor.lua at lua-5.1 · LuaDist/lua · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
This repository was archived by the owner on Nov 20, 2020. It is now read-only.
LuaDist
/
lua
Public archive
Notifications
You must be signed in to change notification settings
Fork
455
Star
1.5k
Code
Pull requests
6
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
lua
/
test
/
fibfor.lua
Copy path
More file actions
More file actions
Latest commit
History
History
History
13 lines (11 loc) · 254 Bytes
Breadcrumbs
lua
/
test
/
fibfor.lua
Copy path
File metadata and controls
13 lines (11 loc) · 254 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
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
Back
|
FazBrowse Home
|
New Git URL