mirror of
https://codeberg.org/andyscott/ziglings.git
synced 2024-11-09 19:40:48 -05:00
18 lines
546 B
Diff
18 lines
546 B
Diff
--- exercises/049_quiz6.zig 2023-10-03 22:15:22.122241138 +0200
|
|
+++ answers/049_quiz6.zig 2023-10-05 20:04:07.062767005 +0200
|
|
@@ -26,9 +26,13 @@
|
|
|
|
// Your Elephant trunk methods go here!
|
|
// ---------------------------------------------------
|
|
+ pub fn getTrunk(self: *Elephant) *Elephant {
|
|
+ return self.trunk.?;
|
|
+ }
|
|
|
|
- ???
|
|
-
|
|
+ pub fn hasTrunk(self: *Elephant) bool {
|
|
+ return (self.trunk != null);
|
|
+ }
|
|
// ---------------------------------------------------
|
|
|
|
pub fn visit(self: *Elephant) void {
|