From 5257941f40554da3f8df074443a4c087dcff7004 Mon Sep 17 00:00:00 2001 From: Martin Ashby Date: Sat, 10 Dec 2022 23:02:40 +0000 Subject: 25-60 complete --- exercises/049_quiz6.zig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'exercises/049_quiz6.zig') 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.?; + } // --------------------------------------------------- -- cgit v1.2.3-ZIG