aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/12_while2.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 /12_while2.zig
parent507355ec3b1066c707e19816b86ac1fb56fc0385 (diff)
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 '12_while2.zig')
-rw-r--r--12_while2.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/12_while2.zig b/12_while2.zig
index dba1a26..6f808c8 100644
--- a/12_while2.zig
+++ b/12_while2.zig
@@ -23,11 +23,13 @@ const std = @import("std");
pub fn main() void {
var n: u32 = 2;
+ // Please set the continue expression so that we get the desired
+ // results in the print statement below.
while (n < 1000) : ??? {
// Print the current number
std.debug.print("{} ", .{n});
}
- // Make this print n=1024
+ // As in the last exercise, we want this to result in "n=1024"
std.debug.print("n={}\n", .{n});
}