diff options
Diffstat (limited to 'exercises/049_quiz6.zig')
-rw-r--r-- | exercises/049_quiz6.zig | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/exercises/049_quiz6.zig b/exercises/049_quiz6.zig index 92541a5..fd358ec 100644 --- a/exercises/049_quiz6.zig +++ b/exercises/049_quiz6.zig @@ -27,7 +27,13 @@ const Elephant = struct { // Your Elephant trunk methods go here! // --------------------------------------------------- - ??? + pub fn hasTrunk(self: *Elephant) bool { + return self.trunk != null; + } + + pub fn getTrunk(self: *Elephant) *Elephant { + return self.trunk.?; + } // --------------------------------------------------- |