Apply zig fmt to exercises
This commit is contained in:
parent
e58f155bd6
commit
2f821bd5e8
37 changed files with 152 additions and 144 deletions
|
|
@ -16,7 +16,7 @@
|
|||
//
|
||||
// WE know there are only three operations but Zig doesn't. Use the
|
||||
// unreachable statement to make the switch complete. Or ELSE. :-)
|
||||
//
|
||||
//
|
||||
const std = @import("std");
|
||||
|
||||
pub fn main() void {
|
||||
|
|
@ -26,9 +26,15 @@ pub fn main() void {
|
|||
|
||||
for (operations) |op| {
|
||||
switch (op) {
|
||||
1 => { current_value += 1; },
|
||||
2 => { current_value -= 1; },
|
||||
3 => { current_value *= current_value; },
|
||||
1 => {
|
||||
current_value += 1;
|
||||
},
|
||||
2 => {
|
||||
current_value -= 1;
|
||||
},
|
||||
3 => {
|
||||
current_value *= current_value;
|
||||
},
|
||||
}
|
||||
|
||||
std.debug.print("{} ", .{current_value});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue