Browse Source

Adding traditional program debugging capability to RubberDuck

Dave Gauer 4 years ago
parent
commit
647f461943
2 changed files with 7 additions and 1 deletions
  1. 6 0
      exercises/070_comptime5.zig
  2. 1 1
      patches/patches/070_comptime5.patch

+ 6 - 0
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 {

+ 1 - 1
patches/patches/070_comptime5.patch

@@ -1,4 +1,4 @@
-116,117c116,117
+122,123c122,123
 <     const walks_like_duck = ???;
 <     const quacks_like_duck = ???;
 ---