From 8859f7a1fe8215853b56c3db3a2d043ae860d405 Mon Sep 17 00:00:00 2001 From: Dave Gauer Date: Thu, 22 Apr 2021 10:31:05 -0400 Subject: Adding traditional program debugging capability to RubberDuck --- exercises/070_comptime5.zig | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'exercises/070_comptime5.zig') 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 { -- cgit v1.2.3-ZIG