diff options
| author | Chris Boesch <chrboesch@noreply.codeberg.org> | 2026-04-07 09:18:37 +0200 |
|---|---|---|
| committer | Chris Boesch <chrboesch@noreply.codeberg.org> | 2026-04-07 09:18:37 +0200 |
| commit | 7cb7a9948a9f5c9965fedd59f0cd816f28962fe4 (patch) | |
| tree | 1953e653faba351ab103ec030eacbfc79b7dae6c /exercises/086_async3.zig | |
| parent | 1166f3cfb65d7edc9086c6ba6b8edd4754964b33 (diff) | |
| parent | 3574fd3ae037f34510c6bb6657332b57447ac5b1 (diff) | |
Merge branch 'main' into fix-060
Diffstat (limited to 'exercises/086_async3.zig')
| -rw-r--r-- | exercises/086_async3.zig | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/exercises/086_async3.zig b/exercises/086_async3.zig deleted file mode 100644 index c8f1113..0000000 --- a/exercises/086_async3.zig +++ /dev/null @@ -1,29 +0,0 @@ -// -// Because they can suspend and resume, async Zig functions are -// an example of a more general programming concept called -// "coroutines". One of the neat things about Zig async functions -// is that they retain their state as they are suspended and -// resumed. -// -// See if you can make this program print "5 4 3 2 1". -// -const print = @import("std").debug.print; - -pub fn main() void { - const n = 5; - var foo_frame = async foo(n); - - ??? - - print("\n", .{}); -} - -fn foo(countdown: u32) void { - var current = countdown; - - while (current > 0) { - print("{} ", .{current}); - current -= 1; - suspend {} - } -} |
