1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
function fibo() a, b = 0, 1 while true do coroutine.yield(a) a, b = b, a + b end end co = coroutine.create(fibo) for i = 1, 20 do print(coroutine.resume(co)) end
and i got for that this
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181
edited 1×, last 25.01.12 05:44:14 pm