mirror of
https://codeberg.org/ziglings/exercises.git
synced 2026-06-09 16:39:58 +00:00
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.
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
//
|
||||
// Behold the 'for' loop! It lets you execute code for each
|
||||
// member of an array (and things called 'slices' which we'll
|
||||
// get to in a bit).
|
||||
// member of an array:
|
||||
//
|
||||
// for (items) |item| {
|
||||
//
|
||||
// // Do something with item
|
||||
//
|
||||
// }
|
||||
//
|
||||
const std = @import("std");
|
||||
@@ -22,3 +23,6 @@ pub fn main() void {
|
||||
|
||||
std.debug.print("The End.\n", .{});
|
||||
}
|
||||
//
|
||||
// Note that "for" loops also work on things called "slices"
|
||||
// which we'll see later.
|
||||
|
||||
Reference in New Issue
Block a user