feat: update single files compile error
This commit is contained in:
@@ -2,7 +2,7 @@ const print = @import("std").debug.print;
|
||||
|
||||
pub fn main() void {
|
||||
const string = [_]u8{ 'a', 'b', 'c' };
|
||||
for (string) |character, index| {
|
||||
for (string, 0..) |character, index| {
|
||||
print("{} - {}\n", .{index, character});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const print = @import("std").debug.print;
|
||||
|
||||
pub fn main() void {
|
||||
var a: ?i32 = null;
|
||||
var b = a orelse 1;
|
||||
print("{} {} \n", .{a, b});
|
||||
const a: ?i32 = null;
|
||||
const b = a orelse 1;
|
||||
print("{?} {} \n", .{a, b});
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ const print = std.debug.print;
|
||||
pub fn main() void {
|
||||
var sum: i32 = 0;
|
||||
var i: i32 = 0;
|
||||
while (i <100) : (i += 1) {
|
||||
while (i < 100) : (i += 1) {
|
||||
sum += i;
|
||||
}
|
||||
print("Sum: {}\n", .{sum});
|
||||
|
||||
Reference in New Issue
Block a user