diff options
| author | Chris Boesch <chrboesch@noreply.codeberg.org> | 2026-04-03 19:32:53 +0200 |
|---|---|---|
| committer | Chris Boesch <chrboesch@noreply.codeberg.org> | 2026-04-03 19:32:53 +0200 |
| commit | 5307b2a338a92130bc498fb1dc7d21a9fd1b0db4 (patch) | |
| tree | 51279ca4fbd7bd90294dd563640c12a8c25c79c6 /exercises/086_async3.zig | |
| parent | 3056a2b5442f2f1ec58db3f3493109064ad2a2a5 (diff) | |
| parent | f6a6798c8b6b813bd2ceee81db276e05327a76e0 (diff) | |
Merge pull request 'revival of the async-io functions' (#383) from asyncIo into main
Reviewed-on: https://codeberg.org/ziglings/exercises/pulls/383
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 {} - } -} |
