summaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
Diffstat (limited to 'patches')
-rw-r--r--patches/patches/058_quiz7.patch6
-rw-r--r--patches/patches/065_builtins2.patch10
-rw-r--r--patches/patches/099_formatting.patch4
-rw-r--r--patches/patches/109_vectors.patch13
4 files changed, 23 insertions, 10 deletions
diff --git a/patches/patches/058_quiz7.patch b/patches/patches/058_quiz7.patch
index 265b9e3..978fbb1 100644
--- a/patches/patches/058_quiz7.patch
+++ b/patches/patches/058_quiz7.patch
@@ -1,8 +1,8 @@
---- exercises/058_quiz7.zig 2023-10-03 22:15:22.125574535 +0200
-+++ answers/058_quiz7.zig 2023-10-05 20:04:07.106101152 +0200
+--- exercises/058_quiz7.zig 2024-10-28 09:06:49.448505460 +0100
++++ answers/058_quiz7.zig 2024-10-28 09:35:14.631932322 +0100
@@ -192,8 +192,8 @@
// Oops! The hermit forgot how to capture the union values
- // in a switch statement. Please capture both values as
+ // in a switch statement. Please capture each value as
// 'p' so the print statements work!
- .place => print("{s}", .{p.name}),
- .path => print("--{}->", .{p.dist}),
diff --git a/patches/patches/065_builtins2.patch b/patches/patches/065_builtins2.patch
index d5da950..e5e6410 100644
--- a/patches/patches/065_builtins2.patch
+++ b/patches/patches/065_builtins2.patch
@@ -1,5 +1,5 @@
---- exercises/065_builtins2.zig 2024-09-02 19:15:56.569952315 +0200
-+++ answers/065_builtins2.zig 2024-09-02 19:13:44.280600350 +0200
+--- exercises/065_builtins2.zig 2024-11-02 16:58:30.607829441 +0100
++++ answers/065_builtins2.zig 2024-11-02 16:58:33.821220588 +0100
@@ -58,7 +58,7 @@
// Oops! We cannot leave the 'me' and 'myself' fields
// undefined. Please set them here:
@@ -24,16 +24,16 @@
// (which is a zero-bit type that takes up no space at all!):
- if (fields[0].??? != void) {
+ if (fields[0].type != void) {
- print(" {s}", .{@typeInfo(Narcissus).@"struct".fields[0].name});
+ print(" {s}", .{fields[0].name});
}
- if (fields[1].??? != void) {
+ if (fields[1].type != void) {
- print(" {s}", .{@typeInfo(Narcissus).@"struct".fields[1].name});
+ print(" {s}", .{fields[1].name});
}
- if (fields[2].??? != void) {
+ if (fields[2].type != void) {
- print(" {s}", .{@typeInfo(Narcissus).@"struct".fields[2].name});
+ print(" {s}", .{fields[2].name});
}
diff --git a/patches/patches/099_formatting.patch b/patches/patches/099_formatting.patch
index 384bf86..a56b556 100644
--- a/patches/patches/099_formatting.patch
+++ b/patches/patches/099_formatting.patch
@@ -1,5 +1,5 @@
---- exercises/099_formatting.zig 2023-10-03 22:15:22.125574535 +0200
-+++ answers/099_formatting.zig 2023-10-05 20:04:07.292771311 +0200
+--- exercises/099_formatting.zig 2024-11-07 21:45:10.459123650 +0100
++++ answers/099_formatting.zig 2024-11-07 21:43:55.154345991 +0100
@@ -131,7 +131,7 @@
for (0..size) |b| {
// What formatting is needed here to make our columns
diff --git a/patches/patches/109_vectors.patch b/patches/patches/109_vectors.patch
new file mode 100644
index 0000000..bf18cc0
--- /dev/null
+++ b/patches/patches/109_vectors.patch
@@ -0,0 +1,13 @@
+--- exercises/109_vectors.zig 2024-11-07 14:57:09.673383618 +0100
++++ answers/109_vectors.zig 2024-11-07 14:22:59.069150138 +0100
+@@ -121,8 +121,8 @@
+
+ const Vec4 = @Vector(4, f32);
+ fn calcMaxPairwiseDiffNew(a: Vec4, b: Vec4) f32 {
+- const abs_diff_vec = ???;
+- const max_diff = @reduce(???, abs_diff_vec);
++ const abs_diff_vec = @abs(a - b);
++ const max_diff = @reduce(.Max, abs_diff_vec);
+ return max_diff;
+ }
+