mirror of
https://git.aramjonghu.dev/AramJonghu/ziglings.git
synced 2026-09-01 08:03:29 +02:00
two exercises
This commit is contained in:
@@ -31,10 +31,14 @@ pub fn main() void {
|
||||
},
|
||||
2 => {
|
||||
current_value -= 1;
|
||||
},
|
||||
else => {
|
||||
unreachable;
|
||||
},
|
||||
3 => {
|
||||
3 => {
|
||||
current_value *= current_value;
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
std.debug.print("{} ", .{current_value});
|
||||
|
||||
@@ -40,6 +40,7 @@ pub fn main() void {
|
||||
} else |err| switch (err) {
|
||||
MyNumberError.TooBig => std.debug.print(">4. ", .{}),
|
||||
// Please add a match for TooSmall here and have it print: "<4. "
|
||||
MyNumberError.TooSmall => std.debug.print("<4. ", .{}),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user