|
|
@ -9,7 +9,6 @@ pub fn main() void {
|
|
|
|
|
|
|
|
|
|
|
|
for (animals) |a| printAnimal(a);
|
|
|
|
for (animals) |a| printAnimal(a);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std.debug.print("done.\n", .{});
|
|
|
|
std.debug.print("done.\n", .{});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -21,9 +20,18 @@ fn printAnimal(animal: u8) void {
|
|
|
|
|
|
|
|
|
|
|
|
std.debug.print(") ", .{}); // <---- how!?
|
|
|
|
std.debug.print(") ", .{}); // <---- how!?
|
|
|
|
|
|
|
|
|
|
|
|
if (animal == 'g'){ std.debug.print("Goat", .{}); return; }
|
|
|
|
if (animal == 'g') {
|
|
|
|
if (animal == 'c'){ std.debug.print("Cat", .{}); return; }
|
|
|
|
std.debug.print("Goat", .{});
|
|
|
|
if (animal == 'd'){ std.debug.print("Dog", .{}); return; }
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (animal == 'c') {
|
|
|
|
|
|
|
|
std.debug.print("Cat", .{});
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (animal == 'd') {
|
|
|
|
|
|
|
|
std.debug.print("Dog", .{});
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std.debug.print("Unknown", .{});
|
|
|
|
std.debug.print("Unknown", .{});
|
|
|
|
}
|
|
|
|
}
|
|
|
|