|
Zth (libzth)
|
More complex coroutine example.
More complex coroutine example.This program will print something like this:
Fiber factory: creating 7.42921 of fiber
Fiber factory: creating 8.33466 of fiber
Fiber factory: creating 4.19363 of fiber
Got 15.7639 of fiber, creating sock 1 (12.5)
Fiber factory: creating 8.79472 of fiber
Waste collector: collected 3.26387 of waste (total 3.26387)
Fiber factory: creating 6.06279 of fiber
Fiber factory: creating 8.04504 of fiber
Got 10.2564 of fiber, creating sock 2 (5)
Waste collector: collected 5.25642 of waste (total 8.5203)
Fiber factory: creating 2.31155 of fiber
Got 16.8398 of fiber, creating sock 3 (12.5)
Fiber factory: creating 5.54631 of fiber
Waste collector: collected 4.33976 of waste (total 12.8601)
Fiber factory: creating 3.57323 of fiber
Fiber factory: creating 7.32052 of fiber
Got 5.88478 of fiber, creating sock 4 (5)
Waste collector: collected 0.884785 of waste (total 13.7448)
Fiber factory: creating 5.92226 of fiber
Packing facility: packed set 1 with sock 1 (12.5), sock 3 (12.5), sock 2 (5), and sock 4 (5)
Got 12.8668 of fiber, creating sock 5 (12.5)
Fiber factory: creating 4.20885 of fiber
Waste collector: collected 0.366831 of waste (total 14.1117)
Got 5.92226 of fiber, creating sock 6 (5)
Waste collector: collected 0.922256 of waste (total 15.0339)
Fiber factory: creating 4.09638 of fiber
Fiber factory: creating 8.35822 of fiber
Fiber factory: creating 2.49278 of fiber
Got 12.5671 of fiber, creating sock 7 (12.5)
Fiber factory: creating 9.02039 of fiber
Waste collector: collected 0.0670719 of waste (total 15.101)
Got 6.58916 of fiber, creating sock 8 (5)
Waste collector: collected 1.58916 of waste (total 16.6902)
Fiber factory: creating 1.02409 of fiber
Packing facility: packed set 2 with sock 5 (12.5), sock 7 (12.5), sock 6 (5), and sock 8 (5)
Fiber factory: creating 3.43832 of fiber
Fiber factory: no more fiber to create