diff options
author | Dave Gauer <dave@ratfactor.com> | 2021-04-22 10:31:05 -0400 |
---|---|---|
committer | Dave Gauer <dave@ratfactor.com> | 2021-04-22 10:31:05 -0400 |
commit | 8859f7a1fe8215853b56c3db3a2d043ae860d405 (patch) | |
tree | d2e81736dcf29ff73e21a4778c8893729bd0d951 /exercises/070_comptime5.zig | |
parent | ca70811f07853cc4ea0b027d9196c8cc74731214 (diff) | |
download | ziglings-8859f7a1fe8215853b56c3db3a2d043ae860d405.tar.gz ziglings-8859f7a1fe8215853b56c3db3a2d043ae860d405.tar.bz2 ziglings-8859f7a1fe8215853b56c3db3a2d043ae860d405.tar.xz ziglings-8859f7a1fe8215853b56c3db3a2d043ae860d405.zip |
Adding traditional program debugging capability to RubberDuck
Diffstat (limited to 'exercises/070_comptime5.zig')
-rw-r--r-- | exercises/070_comptime5.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/exercises/070_comptime5.zig b/exercises/070_comptime5.zig index 7934326..89367bd 100644 --- a/exercises/070_comptime5.zig +++ b/exercises/070_comptime5.zig @@ -52,6 +52,12 @@ const RubberDuck = struct { fn quack(self: RubberDuck) void { print("\"Squeek!\" ", .{}); } + + fn listen(self: RubberDuck, dev_talk: []const u8) void { + // Listen to developer talk about programming problem. + // Silently contemplate problem. Emit helpful sound. + self.quack(); + } }; const Duct = struct { |