aboutsummaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
authorDave Gauer <dave@ratfactor.com>2021-06-30 19:18:13 -0400
committerDave Gauer <dave@ratfactor.com>2021-06-30 19:18:13 -0400
commit14f9325408726d090efc958747e6d5d6dc937d85 (patch)
tree7225b8c1e66910a4104bc3dc6e6d0055c84b996f /patches
parent680e2913f7dc6b6b242e74fd99472b24d57ea3ae (diff)
downloadziglings-14f9325408726d090efc958747e6d5d6dc937d85.tar.gz
ziglings-14f9325408726d090efc958747e6d5d6dc937d85.tar.bz2
ziglings-14f9325408726d090efc958747e6d5d6dc937d85.tar.xz
ziglings-14f9325408726d090efc958747e6d5d6dc937d85.zip
methods NOT namespaced like i expected
Diffstat (limited to 'patches')
-rw-r--r--patches/patches/058_quiz7.patch23
1 files changed, 20 insertions, 3 deletions
diff --git a/patches/patches/058_quiz7.patch b/patches/patches/058_quiz7.patch
index 6b79676..a4e3bbb 100644
--- a/patches/patches/058_quiz7.patch
+++ b/patches/patches/058_quiz7.patch
@@ -1,14 +1,31 @@
-188,189c188,189
+185,186c185,186
< .place => print("{s}", .{p.name}),
< .path => print("--{}->", .{p.dist}),
---
> .place => |p| print("{s}", .{p.name}),
> .path => |p| print("--{}->", .{p.dist}),
-251c251
+248c248
< if (place == entry.*.?.place) return entry;
---
> if (place == entry.*.?.place) return &entry.*.?;
-305c305
+302c302
< fn getTripTo(self: *HermitsNotebook, trip: []?TripItem, dest: *Place) void {
---
> fn getTripTo(self: *HermitsNotebook, trip: []?TripItem, dest: *Place) TripError!void {
+336d335
+< // Note: you do not need to fix anything here.
+419,422c418
+< // We convert the usize length to a u8 with @intCast(), a
+< // builtin function just like @import(). We'll learn about
+< // these properly in a later exercise.
+< var i: u8 = @intCast(u8, trip.len);
+---
+> var i: u8 = @intCast(u8, trip.len); // convert usize length
+449,452c445,446
+< // Search" (BFS).
+< //
+< // By tracking "lowest cost" paths, we can also say that we're
+< // performing a "least-cost search".
+---
+> // Search" (BFS). By tracking "lowest cost" paths, we can also say
+> // that we're performing a "least-cost search".