038_structs2.patch 468 B

123456789101112131415
  1. --- exercises/038_structs2.zig 2023-10-03 22:15:22.122241138 +0200
  2. +++ answers/038_structs2.zig 2023-10-05 20:04:07.012766070 +0200
  3. @@ -42,6 +42,12 @@
  4. //
  5. // Feel free to run this program without adding Zump. What does
  6. // it do and why?
  7. + chars[1] = Character{
  8. + .role = Role.bard,
  9. + .gold = 10,
  10. + .health = 100,
  11. + .experience = 20,
  12. + };
  13. // Printing all RPG characters in a loop:
  14. for (chars, 0..) |c, num| {