Skip to content

Commit d67ec2b

Browse files
committed
continue
1 parent 2357bb4 commit d67ec2b

4 files changed

Lines changed: 9 additions & 5 deletions

File tree

.progress.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
46
1+
49

exercises/047_methods.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ pub fn main() void {
8888
for (&aliens) |*alien| {
8989

9090
// *** Zap the alien with the heat ray here! ***
91-
???.zap(???);
91+
heat_ray.zap(alien);
9292

9393
// If the alien's health is still above 0, it's still alive.
9494
if (alien.health > 0) aliens_alive += 1;

exercises/048_methods2.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fn visitElephants(first_elephant: *Elephant) void {
5454

5555
// This gets the next elephant or stops:
5656
// which method do we want here?
57-
e = if (e.hasTail()) e.??? else break;
57+
e = if (e.hasTail()) e.getTail() else break;
5858
}
5959
}
6060

exercises/049_quiz6.zig

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ const Elephant = struct {
2727
// Your Elephant trunk methods go here!
2828
// ---------------------------------------------------
2929

30-
???
31-
30+
pub fn hasTrunk(self: *Elephant) bool {
31+
return self.trunk != null;
32+
}
33+
pub fn getTrunk(self: *Elephant) *Elephant {
34+
return self.trunk.?;
35+
}
3236
// ---------------------------------------------------
3337

3438
pub fn visit(self: *Elephant) void {

0 commit comments

Comments
 (0)