diff options
Diffstat (limited to 'patches')
| -rwxr-xr-x | patches/eowyn.sh | 14 | ||||
| -rw-r--r-- | patches/patches/046_optionals2.patch | 4 | ||||
| -rw-r--r-- | patches/patches/058_quiz7.patch | 6 | ||||
| -rw-r--r-- | patches/patches/065_builtins2.patch | 10 | ||||
| -rw-r--r-- | patches/patches/099_formatting.patch | 4 | ||||
| -rw-r--r-- | patches/patches/100_for4.patch | 2 | ||||
| -rw-r--r-- | patches/patches/106_files.patch | 8 | ||||
| -rw-r--r-- | patches/patches/107_files2.patch | 2 | ||||
| -rw-r--r-- | patches/patches/109_vectors.patch | 13 |
9 files changed, 44 insertions, 19 deletions
diff --git a/patches/eowyn.sh b/patches/eowyn.sh index 8cac450..afc2732 100755 --- a/patches/eowyn.sh +++ b/patches/eowyn.sh @@ -12,6 +12,12 @@ # using the patches in this directory and convey them # to convalesce in the healed directory. # +delete_progress() { + progress_file=".progress.txt" + if [ -f $progress_file ]; then + rm $progress_file + fi +} set -e # We check ourselves before we wreck ourselves. @@ -23,9 +29,12 @@ fi # Which version we have? echo "Zig version" $(zig version) -echo "Eowyn version 23.10.5.1, let's try our magic power." +echo "Eowyn version 25.1.9, let's try our magic power." echo "" +# Remove progress file +delete_progress + # Create directory of healing if it doesn't already exist. mkdir -p patches/healed @@ -54,3 +63,6 @@ zig fmt --check patches/healed # Test the healed exercises. May the compiler have mercy upon us. zig build -Dhealed + +# Remove progress file again +delete_progress diff --git a/patches/patches/046_optionals2.patch b/patches/patches/046_optionals2.patch index 1b364a6..8fa01a2 100644 --- a/patches/patches/046_optionals2.patch +++ b/patches/patches/046_optionals2.patch @@ -1,5 +1,5 @@ ---- exercises/046_optionals2.zig 2024-09-04 20:51:36.766783971 +0200 -+++ answers/046_optionals2.zig 2024-09-04 20:51:01.389400985 +0200 +--- exercises/046_optionals2.zig 2024-11-08 22:46:25.592875338 +0100 ++++ answers/046_optionals2.zig 2024-11-08 22:46:20.699447951 +0100 @@ -22,7 +22,7 @@ const Elephant = struct { 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/100_for4.patch b/patches/patches/100_for4.patch index 3539be2..ad73e9a 100644 --- a/patches/patches/100_for4.patch +++ b/patches/patches/100_for4.patch @@ -7,5 +7,5 @@ - for (hex_nums, ???) |hn, ???| { + for (hex_nums, dec_nums) |hn, dn| { if (hn != dn) { - std.debug.print("Uh oh! Found a mismatch: {d} vs {d}\n", .{ hn, dn }); + print("Uh oh! Found a mismatch: {d} vs {d}\n", .{ hn, dn }); return; diff --git a/patches/patches/106_files.patch b/patches/patches/106_files.patch index 5eb5a19..89f37ad 100644 --- a/patches/patches/106_files.patch +++ b/patches/patches/106_files.patch @@ -1,5 +1,5 @@ ---- exercises/106_files.zig 2024-06-17 10:11:53.651439869 +0200 -+++ answers/106_files.zig 2024-06-17 10:21:50.697337653 +0200 +--- exercises/106_files.zig 2024-11-09 20:33:07.455580904 +0100 ++++ answers/106_files.zig 2024-11-09 20:33:30.394785215 +0100 @@ -1,22 +1,22 @@ // // Until now, we've only been printing our output in the console, @@ -17,9 +17,9 @@ +// by organizing files into directories, which hold files and other directories, +// thus creating a tree structure for navigating. // --// Fortunately, the Zig standard library provides a simple API for interacting +-// Fortunately, the Zig Standard Library provides a simple API for interacting -// with the file system, see the detail documentation here: -+// Fortunately, zig standard library provide a simple api for interacting ++// Fortunately, the Zig Standard Library provide a simple api for interacting +// with the file system, see the detail documentation here // // https://ziglang.org/documentation/master/std/#std.fs diff --git a/patches/patches/107_files2.patch b/patches/patches/107_files2.patch index ebf8a7c..f03a2e8 100644 --- a/patches/patches/107_files2.patch +++ b/patches/patches/107_files2.patch @@ -42,7 +42,7 @@ - // can you go here to find a way to read the content? + // can you go here to find a way to read the content ? // https://ziglang.org/documentation/master/std/#std.fs.File - // hint: you might find two answers that are both vaild in this case + // hint: you might find two answers that are both valid in this case - const bytes_read = zig_read_the_file_or_i_will_fight_you(&content); + const bytes_read = try file.read(&content); 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; + } + |
