summaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
authorChris Boesch <chrboesch@noreply.codeberg.org>2026-06-02 08:56:50 +0200
committerChris Boesch <chrboesch@noreply.codeberg.org>2026-06-02 08:56:50 +0200
commitf6dda8181a28cc5bbb343900bec7d8157f51536e (patch)
treeb5dae98c4dacbcc5046bddebd5488938894a9210 /patches
parentac9f96459ce1ce2c1cec5605cf6075d0fbf559b7 (diff)
parentbd55c4ac5a235778f78b91c37a0bf1516bfbcc55 (diff)
Merge pull request 'Add another defer exercise' (#438) from mark2185/exercises:defer3 into main
Reviewed-on: https://codeberg.org/ziglings/exercises/pulls/438
Diffstat (limited to 'patches')
-rw-r--r--patches/patches/028_defer2.patch18
1 files changed, 15 insertions, 3 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;