aboutsummaryrefslogtreecommitdiff
path: root/02_std.zig
diff options
context:
space:
mode:
authorDave Gauer <dave@ratfactor.com>2021-02-07 11:06:51 -0500
committerDave Gauer <dave@ratfactor.com>2021-02-07 11:06:51 -0500
commitadf5ddb27df7f5a22b0b7d3321dfc8bca1e7937a (patch)
treea25511c3bb20069f1d6123366573c82c5745338b /02_std.zig
parent507355ec3b1066c707e19816b86ac1fb56fc0385 (diff)
downloadziglings-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.zig15
1 files changed, 9 insertions, 6 deletions
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", .{});