two exercises

This commit is contained in:
2026-06-05 20:15:57 +02:00
parent b8ba0dbb54
commit 629634e09d
2 changed files with 6 additions and 1 deletions
+5 -1
View File
@@ -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});
+1
View File
@@ -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. ", .{}),
}
}