087_async4.patch 440 B

123456789101112131415161718192021
  1. --- exercises/087_async4.zig 2023-10-03 22:15:22.125574535 +0200
  2. +++ answers/087_async4.zig 2023-10-05 20:04:07.236103584 +0200
  3. @@ -16,7 +16,7 @@
  4. while (global_counter <= 5) {
  5. print("{} ", .{global_counter});
  6. - ???
  7. + resume foo_frame;
  8. }
  9. print("\n", .{});
  10. @@ -24,7 +24,7 @@
  11. fn foo() void {
  12. while (true) {
  13. - ???
  14. - ???
  15. + global_counter += 1;
  16. + suspend {}
  17. }
  18. }