Add solutions

This commit is contained in:
Laurens Miers 2024-09-25 15:26:17 +02:00
parent 7417f01d5d
commit b056b6ad81
96 changed files with 229 additions and 166 deletions

View file

@ -19,7 +19,7 @@ pub fn main() void {
// the idiomatic type to use for array indexing.
//
// There IS a problem on this line, but 'usize' isn't it.
const x: usize = 1;
var x: usize = 1;
// Note: When you want to declare memory (an array in this
// case) without putting anything in it, you can set it to
@ -33,10 +33,11 @@ pub fn main() void {
lang[0] = letters[x];
x = 3;
lang[???] = letters[x];
lang[1] = letters[x];
x = ???;
lang[2] = letters[???];
// x = letters.len - 1;
x = letters.len - 1;
lang[2] = letters[x];
// We want to "Program in Zig!" of course:
std.debug.print("Program in {s}!\n", .{lang});