This commit is contained in:
parent
69940c6103
commit
d76bac99e2
|
@ -19,12 +19,14 @@ const Elephant = struct {
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue