You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ziglings/patches/patches/044_quiz5.patch

18 lines
667 B
Diff

--- exercises/044_quiz5.zig 2023-10-03 22:15:22.122241138 +0200
+++ answers/044_quiz5.zig 2023-10-05 20:04:07.039433235 +0200
@@ -19,12 +19,14 @@
pub fn main() void {
var elephantA = Elephant{ .letter = 'A' };
// (Please add Elephant B here!)
+ var elephantB = Elephant{ .letter = 'B' };
var elephantC = Elephant{ .letter = 'C' };
// Link the elephants so that each tail "points" to the next elephant.
// They make a circle: A->B->C->A...
elephantA.tail = &elephantB;
// (Please link Elephant B's tail to Elephant C here!)
+ elephantB.tail = &elephantC;
elephantC.tail = &elephantA;
visitElephants(&elephantA);