mirror of
https://github.com/bloeys/cogo.git
synced 2025-12-29 08:58:19 +00:00
Stuff
This commit is contained in:
22
main.go
22
main.go
@ -9,23 +9,29 @@ import (
|
||||
"github.com/bloeys/cogo/cogo"
|
||||
)
|
||||
|
||||
func test_cogo(c *cogo.Coroutine[int, int]) (out int) { return 0 }
|
||||
|
||||
func test(c *cogo.Coroutine[int, int]) (out int) {
|
||||
|
||||
if cogo.HasGen() {
|
||||
return test_cogo(c)
|
||||
}
|
||||
|
||||
c.Begin()
|
||||
|
||||
println("Tick 1")
|
||||
c.Yield(1)
|
||||
// c.Yield(1)
|
||||
|
||||
println("Tick 2")
|
||||
c.Yield(2)
|
||||
// println("Tick 2")
|
||||
// c.Yield(2)
|
||||
|
||||
println("Tick 3")
|
||||
c.Yield(3)
|
||||
// println("Tick 3")
|
||||
// c.Yield(3)
|
||||
|
||||
println("Tick 4")
|
||||
c.Yield(4)
|
||||
// println("Tick 4")
|
||||
// c.Yield(4)
|
||||
|
||||
println("Tick before end")
|
||||
// println("Tick before end")
|
||||
|
||||
return out
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user