From adf5ddb27df7f5a22b0b7d3321dfc8bca1e7937a Mon Sep 17 00:00:00 2001 From: Dave Gauer Date: Sun, 7 Feb 2021 11:06:51 -0500 Subject: Consistent instructions and examples I started off with "hints" that required the poor student to piece together the information from incomplete bits. A complete example is like a picture that is worth 1000 words and far clearer. --- 02_std.zig | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to '02_std.zig') diff --git a/02_std.zig b/02_std.zig index 62ce040..dcc1b87 100644 --- a/02_std.zig +++ b/02_std.zig @@ -2,13 +2,16 @@ // Oops! This program is supposed to print a line like our Hello World // example. But we forgot how to import the Zig Standard Library. // -// Hint 1: The @import() built-in function returns a value representing -// imported code. We need to give that value a name to use it. -// Hint 2: We use the name "std" in the main function (see below). -// Hint 3: Imports need to be named by declaring them as "const" values. -// Hint 4: Take a look at how the previous exercise did this! +// The @import() function is built into Zig. It returns a value which +// represents the imported code. It's a good idea to store the import as +// a constant value with the same name as the import: // -@import("std"); +// const foo = @import("foo"); +// +// Please complete the import below: +// + +??? = @import("std"); pub fn main() void { std.debug.print("Standard Library.\n", .{}); -- cgit v1.2.3-ZIG