mirror of
https://codeberg.org/ziglings/exercises.git
synced 2026-06-10 17:09:59 +00:00
Adding traditional program debugging capability to RubberDuck
This commit is contained in:
@@ -52,6 +52,12 @@ const RubberDuck = struct {
|
|||||||
fn quack(self: RubberDuck) void {
|
fn quack(self: RubberDuck) void {
|
||||||
print("\"Squeek!\" ", .{});
|
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 {
|
const Duct = struct {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
116,117c116,117
|
122,123c122,123
|
||||||
< const walks_like_duck = ???;
|
< const walks_like_duck = ???;
|
||||||
< const quacks_like_duck = ???;
|
< const quacks_like_duck = ???;
|
||||||
---
|
---
|
||||||
|
|||||||
Reference in New Issue
Block a user