diff options
author | Dave Gauer <dave@ratfactor.com> | 2021-02-07 11:06:51 -0500 |
---|---|---|
committer | Dave Gauer <dave@ratfactor.com> | 2021-02-07 11:06:51 -0500 |
commit | adf5ddb27df7f5a22b0b7d3321dfc8bca1e7937a (patch) | |
tree | a25511c3bb20069f1d6123366573c82c5745338b /02_std.zig | |
parent | 507355ec3b1066c707e19816b86ac1fb56fc0385 (diff) | |
download | ziglings-adf5ddb27df7f5a22b0b7d3321dfc8bca1e7937a.tar.gz ziglings-adf5ddb27df7f5a22b0b7d3321dfc8bca1e7937a.tar.bz2 ziglings-adf5ddb27df7f5a22b0b7d3321dfc8bca1e7937a.tar.xz ziglings-adf5ddb27df7f5a22b0b7d3321dfc8bca1e7937a.zip |
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.
Diffstat (limited to '02_std.zig')
-rw-r--r-- | 02_std.zig | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -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", .{}); |