mirror of
https://codeberg.org/andyscott/ziglings.git
synced 2024-12-22 22:13:11 -05:00
6b17a18893
Add the check-exercises.py tool in the new tools directory. It is used to check that the exercises are correctly formatted, printing on stderr the invalid ones and the diff in the unified format. Update the exercises that don't use the canonical zig fmt format. Update some patches that cause the generated zig file to be incorrectly formatted.
25 lines
631 B
Zig
25 lines
631 B
Zig
//
|
|
// Anonymous struct literal syntax can also be used to compose an
|
|
// "anonymous list" with an array type destination:
|
|
//
|
|
// const foo: [3]u32 = .{10, 20, 30};
|
|
//
|
|
// Otherwise it's a "tuple":
|
|
//
|
|
// const bar = .{10, 20, 30};
|
|
//
|
|
// The only difference is the destination type.
|
|
//
|
|
const print = @import("std").debug.print;
|
|
|
|
pub fn main() void {
|
|
// Please make 'hello' a string-like array of u8 WITHOUT
|
|
// changing the value literal.
|
|
//
|
|
// Don't change this part:
|
|
//
|
|
// = .{ 'h', 'e', 'l', 'l', 'o' };
|
|
//
|
|
const hello = .{ 'h', 'e', 'l', 'l', 'o' };
|
|
print("I say {s}!\n", .{hello});
|
|
}
|