summaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
authorChris Boesch <chrboesch@noreply.codeberg.org>2026-06-03 17:39:58 +0200
committerChris Boesch <chrboesch@noreply.codeberg.org>2026-06-03 17:39:58 +0200
commita403436fe8ca2ce7fc53e81365f91ecc6051ef97 (patch)
tree6c3f664ff0a900e0d1132f54a1c0410baf389e33 /patches
parent3b865a0c175e7537aeea389fb5f05c6e3489a685 (diff)
parentbeeca8d510891a272868f447e8193b0fcee7e2fc (diff)
Merge branch 'main' into fix-build-update
Diffstat (limited to 'patches')
-rw-r--r--patches/patches/028_defer2.patch18
-rw-r--r--patches/patches/110_files2.patch10
2 files changed, 20 insertions, 8 deletions
diff --git a/patches/patches/028_defer2.patch b/patches/patches/028_defer2.patch
index f09b1e5..28eb806 100644
--- a/patches/patches/028_defer2.patch
+++ b/patches/patches/028_defer2.patch
@@ -1,6 +1,6 @@
---- exercises/028_defer2.zig 2023-10-03 22:15:22.122241138 +0200
-+++ answers/028_defer2.zig 2023-10-05 20:04:06.966098530 +0200
-@@ -18,7 +18,7 @@
+--- exercises/028_defer2.zig 2026-06-02 06:08:12.713672612 +0200
++++ answers/028_defer2.zig 2026-06-02 06:08:43.262234023 +0200
+@@ -20,7 +20,7 @@
fn printAnimal(animal: u8) void {
std.debug.print("(", .{});
@@ -9,3 +9,15 @@
if (animal == 'g') {
std.debug.print("Goat", .{});
+@@ -51,9 +51,9 @@
+
+ // Try reordering the statements to get the answer 42
+ {
+- defer x = x / 10;
+- defer x = x + 11;
+ defer x = x * 2;
++ defer x = x + 11;
++ defer x = x / 10;
+ }
+
+ return x;
diff --git a/patches/patches/110_files2.patch b/patches/patches/110_files2.patch
index 8d65ef8..311d7b1 100644
--- a/patches/patches/110_files2.patch
+++ b/patches/patches/110_files2.patch
@@ -1,10 +1,10 @@
---- exercises/110_files2.zig 2026-05-04 17:08:38.913033915 +0200
-+++ answers/110_files2.zig 2026-05-04 17:08:37.112995948 +0200
+--- exercises/110_files2.zig 2026-05-31 14:54:55.061019159 +0200
++++ answers/110_files2.zig 2026-05-31 14:54:42.655691238 +0200
@@ -39,7 +39,7 @@
- // initialize an array of u8 with all letter 'A'
+ // initialize an array of u8 entirely with the letter 'A'
// we need to pick the size of the array, 64 seems like a good number
- // fix the initialization below
-- var content = ['A']*64;
+ // do you remember the array repetition function?
+- var content: ??? = ???('A');
+ var content: [64]u8 = @splat('A');
// this should print out : `AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA`
std.debug.print("{s}\n", .{content});