31 - plus opinionated convert to const
This commit is contained in:
parent
1d9ada1c08
commit
4579805357
|
@ -15,7 +15,7 @@ pub fn main() void {
|
|||
const lang_chars = [_]u8{ 26, 9, 7, 42 };
|
||||
|
||||
for (lang_chars) |c| {
|
||||
var real_char: u8 = switch (c) {
|
||||
const real_char: u8 = switch (c) {
|
||||
1 => 'A',
|
||||
2 => 'B',
|
||||
3 => 'C',
|
||||
|
@ -31,6 +31,7 @@ pub fn main() void {
|
|||
26 => 'Z',
|
||||
// As in the last exercise, please add the 'else' clause
|
||||
// and this time, have it return an exclamation mark '!'.
|
||||
else => '!',
|
||||
};
|
||||
|
||||
std.debug.print("{c}", .{real_char});
|
||||
|
|
Loading…
Reference in New Issue