18_functions.zig 505 B

12345678910111213141516171819
  1. //
  2. // Functions! FUNctions! FUN!
  3. //
  4. const std = @import("std");
  5. pub fn main() void {
  6. // The new function deepThought() should return the number 42. See below.
  7. const answer: u8 = deepThought();
  8. std.debug.print("Answer to the Ultimate Question: {}\n", .{answer});
  9. }
  10. //
  11. // We're just missing a couple things here. One thing we're NOT missing is the
  12. // keyword 'pub', which is not needed here. Can you guess why?
  13. //
  14. ??? deepThought() ??? {
  15. return 42; // Number courtesy Douglas Adams
  16. }