From 522b4673a426258d1299abd75021a9510644f9ba Mon Sep 17 00:00:00 2001
From: Jost Alemann <jost_alemann@me.com>
Date: Thu, 20 Mar 2025 21:24:40 +0100
Subject: [PATCH] fix: typos

---
 build.zig                        | 2 +-
 exercises/033_iferror.zig        | 2 +-
 exercises/071_comptime6.zig      | 2 +-
 exercises/105_threading2.zig     | 6 +++---
 exercises/107_files2.zig         | 6 +++---
 exercises/108_labeled_switch.zig | 2 +-
 exercises/110_quiz9.zig          | 4 ++--
 patches/patches/107_files2.patch | 4 ++--
 8 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/build.zig b/build.zig
index 8941610..2d7d2f4 100644
--- a/build.zig
+++ b/build.zig
@@ -200,7 +200,7 @@ pub fn build(b: *Build) !void {
 
     if (rand) |_| {
         // Random build mode: verifies one random exercise.
-        // like for 'exno' but chooses a random exersise number.
+        // like for 'exno' but chooses a random exercise number.
         print("work in progress: check a random exercise\n", .{});
 
         var prng = std.Random.DefaultPrng.init(blk: {
diff --git a/exercises/033_iferror.zig b/exercises/033_iferror.zig
index 6ba0c61..12da2d2 100644
--- a/exercises/033_iferror.zig
+++ b/exercises/033_iferror.zig
@@ -17,7 +17,7 @@
 //
 //     if (foo) |value| {
 //         ...
-//     } else |err| switch(err) {
+//     } else |err| switch (err) {
 //         ...
 //     }
 //
diff --git a/exercises/071_comptime6.zig b/exercises/071_comptime6.zig
index 5938abc..9b3e5a2 100644
--- a/exercises/071_comptime6.zig
+++ b/exercises/071_comptime6.zig
@@ -7,7 +7,7 @@
 // doing this work.
 //
 // An 'inline for' is performed at compile time, allowing you to
-// programatically loop through a series of items in situations
+// programmatically loop through a series of items in situations
 // like those mentioned above where a regular runtime 'for' loop
 // wouldn't be allowed:
 //
diff --git a/exercises/105_threading2.zig b/exercises/105_threading2.zig
index 7e16a1c..374391a 100644
--- a/exercises/105_threading2.zig
+++ b/exercises/105_threading2.zig
@@ -21,9 +21,9 @@
 // There were the Scottish mathematician Gregory and the German
 // mathematician Leibniz, and even a few hundred years earlier the Indian
 // mathematician Madhava. All of them independently developed the same
-// formula, which was published by Leibnitz in 1682 in the journal
+// formula, which was published by Leibniz in 1682 in the journal
 // "Acta Eruditorum".
-// This is why this method has become known as the "Leibnitz series",
+// This is why this method has become known as the "Leibniz series",
 // although the other names are also often used today.
 // We will not go into the formula and its derivation in detail, but
 // will deal with the series straight away:
@@ -50,7 +50,7 @@
 // enough for us for now, because we want to understand the principle and
 // nothing more, right?
 //
-// As we have already discovered, the Leibnitz series is a series with a
+// As we have already discovered, the Leibniz series is a series with a
 // fixed distance of 2 between the individual partial values. This makes
 // it easy to apply a simple loop to it, because if we start with n = 1
 // (which is not necessarily useful now) we always have to add 2 in each
diff --git a/exercises/107_files2.zig b/exercises/107_files2.zig
index 6768898..d059879 100644
--- a/exercises/107_files2.zig
+++ b/exercises/107_files2.zig
@@ -12,7 +12,7 @@
 // Alright, bud, lean in close. Here's the game plan.
 //    - First, we open the {project_root}/output/ directory
 //    - Secondly, we open file `zigling.txt` in that directory
-//    - Then, we initalize an array of characters with all letter 'A', and print it
+//    - Then, we initialize an array of characters with all letter 'A', and print it
 //    - After that, we read the content of the file into the array
 //    - Finally, we print out the content we just read
 
@@ -30,9 +30,9 @@ pub fn main() !void {
     const file = try output_dir.openFile("zigling.txt", .{});
     defer file.close();
 
-    // initalize an array of u8 with all letter 'A'
+    // initialize an array of u8 with all letter 'A'
     // we need to pick the size of the array, 64 seems like a good number
-    // fix the initalization below
+    // fix the initialization below
     var content = ['A']*64;
     // this should print out : `AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA`
     std.debug.print("{s}\n", .{content});
diff --git a/exercises/108_labeled_switch.zig b/exercises/108_labeled_switch.zig
index 16a5879..9262c6f 100644
--- a/exercises/108_labeled_switch.zig
+++ b/exercises/108_labeled_switch.zig
@@ -24,7 +24,7 @@
 //
 // By combining all we've learned so far, we can now proceed with a labeled switch
 //
-// A labeled switch is some extra syntatic sugar, which comes with all sorts of
+// A labeled switch is some extra syntactic sugar, which comes with all sorts of
 // candy (performance benefits). Don't believe me? Directly to source https://github.com/ziglang/zig/pull/21367
 //
 // Here is the previous excerpt implemented as a labeled switch instead:
diff --git a/exercises/110_quiz9.zig b/exercises/110_quiz9.zig
index cd0048b..8f5cb61 100644
--- a/exercises/110_quiz9.zig
+++ b/exercises/110_quiz9.zig
@@ -161,7 +161,7 @@ pub fn main() !void {
 // In order to output a 1, the logic of an XOR operation requires that the
 // two input bits are of different values. Therefore, 0 ^ 1 and 1 ^ 0 will
 // both yield a 1 but 0 ^ 0 and 1 ^ 1 will output 0. XOR's unique behavior
-// of outputing a 0 when both inputs are 1s is what makes it different from
+// of outputting a 0 when both inputs are 1s is what makes it different from
 // the OR operator; it also gives us the ability to toggle bits by putting
 // 1s into our bitmask.
 //
@@ -247,7 +247,7 @@ pub fn main() !void {
 // PORTB = PORTB & 0b1011;
 // print("PORTB: {b:0>4}\n", .{PORTB}); // output -> 1010
 //
-// - 0s clear bits when used in conjuction with a bitwise AND.
+// - 0s clear bits when used in conjunction with a bitwise AND.
 // - 1s do nothing, thus preserving the original bits.
 //
 // -AND op- ---expanded---
diff --git a/patches/patches/107_files2.patch b/patches/patches/107_files2.patch
index 7e2692f..95aaa0c 100644
--- a/patches/patches/107_files2.patch
+++ b/patches/patches/107_files2.patch
@@ -1,9 +1,9 @@
 --- exercises/107_files2.zig	2025-03-13 15:26:59.532367792 +0200
 +++ answers/107_files2.zig	2025-03-14 22:08:35.167953736 +0200
 @@ -33,7 +33,7 @@
-     // initalize an array of u8 with all letter 'A'
+     // initialize an array of u8 with all letter 'A'
      // we need to pick the size of the array, 64 seems like a good number
-     // fix the initalization below
+     // fix the initialization below
 -    var content = ['A']*64;
 +    var content = [_]u8{'A'} ** 64;
      // this should print out : `AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA`