Add solutions
This commit is contained in:
parent
7417f01d5d
commit
b056b6ad81
96 changed files with 229 additions and 166 deletions
|
|
@ -44,14 +44,14 @@ pub fn main() void {
|
|||
std.debug.print("Insect report! ", .{});
|
||||
|
||||
// Could it really be as simple as just passing the union?
|
||||
printInsect(???);
|
||||
printInsect(???);
|
||||
printInsect(ant);
|
||||
printInsect(bee);
|
||||
|
||||
std.debug.print("\n", .{});
|
||||
}
|
||||
|
||||
fn printInsect(insect: Insect) void {
|
||||
switch (???) {
|
||||
switch (insect) {
|
||||
.still_alive => |a| std.debug.print("Ant alive is: {}. ", .{a}),
|
||||
.flowers_visited => |f| std.debug.print("Bee visited {} flowers. ", .{f}),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue