zig/test/cases/switch.1.zig

15 lines
180 B
Zig
Raw Normal View History

2022-04-27 21:59:55 +01:00
pub fn main() u8 {
var val: u8 = 2;
var a: u8 = switch (val) {
0, 1 => 2,
2 => 3,
3 => 4,
else => 5,
};
return a - 3;
}
// run
//