076_sentinels.patch 684 B

1234567891011121314151617181920
  1. --- exercises/076_sentinels.zig 2023-10-03 22:15:22.125574535 +0200
  2. +++ answers/076_sentinels.zig 2023-10-05 20:04:07.186102649 +0200
  3. @@ -82,7 +82,7 @@
  4. print("Array:", .{});
  5. // Loop through the items in my_seq.
  6. - for (???) |s| {
  7. + for (my_seq) |s| {
  8. print("{}", .{s});
  9. }
  10. },
  11. @@ -94,7 +94,7 @@
  12. // Loop through the items in my_seq until we hit the
  13. // sentinel value.
  14. var i: usize = 0;
  15. - while (??? != my_sentinel) {
  16. + while (my_seq[i] != my_sentinel) {
  17. print("{}", .{my_seq[i]});
  18. i += 1;
  19. }