From 1891f99502c12197b60e129d02554445481aa014 Mon Sep 17 00:00:00 2001 From: mmsaki Date: Mon, 8 Jun 2026 05:55:17 +0200 Subject: fix typo --- exercises/114_packed.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'exercises') diff --git a/exercises/114_packed.zig b/exercises/114_packed.zig index 933ae0a..deb91e4 100644 --- a/exercises/114_packed.zig +++ b/exercises/114_packed.zig @@ -78,7 +78,7 @@ const FLG = packed struct(u8) { content_checksum: bool, content_size: bool, block_checksum: bool, - block_indepencence: bool, + block_independence: bool, version: u2, }; -- cgit v1.2.3 From d39241a20e3e100d3cc467e86854da9bfdd56e47 Mon Sep 17 00:00:00 2001 From: xaviii Date: Tue, 9 Jun 2026 08:54:40 +0200 Subject: Fixed typo: "you will wish" -> "you wish" --- exercises/043_pointers5.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'exercises') diff --git a/exercises/043_pointers5.zig b/exercises/043_pointers5.zig index 9e2fa6f..3117639 100644 --- a/exercises/043_pointers5.zig +++ b/exercises/043_pointers5.zig @@ -1,6 +1,6 @@ // // As with integers, you can pass a pointer to a struct when you -// will wish to modify that struct. Pointers are also useful when +// wish to modify that struct. Pointers are also useful when // you need to store a reference to a struct (a "link" to it). // // const Vertex = struct{ x: u32, y: u32, z: u32 }; -- cgit v1.2.3 From bc443a1113b68a668a6a024ed4b1e7eb2d7c0d80 Mon Sep 17 00:00:00 2001 From: Michael Walker Date: Thu, 11 Jun 2026 09:58:17 -0400 Subject: Fixed a couple of exercise references as they are no longer accurate after the recent changes - Exercise 107 claimed the async exercises are 84-91, they are actually 85-94 and quiz 95 - Exercise 113 claimed the bit manip exercise is 097, it is now 100 - Exercise 114 has the bit manipulation exercises as 097 and 098, they are now 100 and 101 - Exercise 114 has the last switch exercise as being 108, it is now 111. --- exercises/107_threading.zig | 2 +- exercises/113_quiz9.zig | 2 +- exercises/114_packed.zig | 2 +- exercises/115_packed2.zig | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'exercises') diff --git a/exercises/107_threading.zig b/exercises/107_threading.zig index 3c3fa21..c24757f 100644 --- a/exercises/107_threading.zig +++ b/exercises/107_threading.zig @@ -1,5 +1,5 @@ // -// In Exercises 84-91, we learned about Zig's Io interface for +// In Exercises 85-94, we learned about Zig's Io interface for // concurrent execution: io.async(), Group, Select, and Futures. // Under the hood, the Threaded backend manages a pool of real // OS threads for you - including scheduling, cancellation, and diff --git a/exercises/113_quiz9.zig b/exercises/113_quiz9.zig index 8f5cb61..8d1da9c 100644 --- a/exercises/113_quiz9.zig +++ b/exercises/113_quiz9.zig @@ -14,7 +14,7 @@ // // A common activity in microcontroller programming is setting and clearing // bits on input and output pins. This lets you control LEDs, sensors, motors -// and more! In a previous exercise (097_bit_manipulation.zig) you learned how +// and more! In a previous exercise (100_bit_manipulation.zig) you learned how // to swap two bytes using the ^ (XOR - exclusive or) operator. This quiz will // test your knowledge of bit manipulation in Zig while giving you a taste of // what it's like to control registers in a real microcontroller. Included at diff --git a/exercises/114_packed.zig b/exercises/114_packed.zig index 933ae0a..3f605a2 100644 --- a/exercises/114_packed.zig +++ b/exercises/114_packed.zig @@ -1,6 +1,6 @@ // // We've already learned plenty about bit manipulation using bitwise operations -// in exercises 097 and 098 and in quiz 110. The techniques we already know work +// in exercises 100 and 101 and in quiz 113. The techniques we already know work // just fine, but creating masks and shifting individual bits around can become // quite tedious and unwieldy pretty quickly. // What if there was a better, a more convenient way to control individual bits? diff --git a/exercises/115_packed2.zig b/exercises/115_packed2.zig index 2b6b558..59d31e1 100644 --- a/exercises/115_packed2.zig +++ b/exercises/115_packed2.zig @@ -1,5 +1,5 @@ // -// We've already learned about switch statements in exercises 030, 031 and 108. +// We've already learned about switch statements in exercises 030, 031 and 111. // They also work with packed containers: const S = packed struct(u2) { -- cgit v1.2.3 From c24a170ca853063f6c3ebdae69dc27d957740263 Mon Sep 17 00:00:00 2001 From: Michael Walker Date: Thu, 11 Jun 2026 09:59:17 -0400 Subject: missed a change to add the phrase 'and quiz 95' to the statement regarding Zig's Io interface. --- exercises/107_threading.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'exercises') diff --git a/exercises/107_threading.zig b/exercises/107_threading.zig index c24757f..2b7d4c0 100644 --- a/exercises/107_threading.zig +++ b/exercises/107_threading.zig @@ -1,5 +1,5 @@ // -// In Exercises 85-94, we learned about Zig's Io interface for +// In Exercises 85-94 and quiz 95, we learned about Zig's Io interface for // concurrent execution: io.async(), Group, Select, and Futures. // Under the hood, the Threaded backend manages a pool of real // OS threads for you - including scheduling, cancellation, and -- cgit v1.2.3 From 2cf2a885fd564f6d7a8ca7c506b27288951bda9e Mon Sep 17 00:00:00 2001 From: Filip Kubiš Date: Sat, 20 Jun 2026 11:18:05 +0200 Subject: Use significand terminology As exercise 60 says: Donald Knuth would not be happy with us calling this mantissa. Proposing to use the less amiguous term significand --- exercises/115_packed2.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'exercises') diff --git a/exercises/115_packed2.zig b/exercises/115_packed2.zig index 2b6b558..bd25e20 100644 --- a/exercises/115_packed2.zig +++ b/exercises/115_packed2.zig @@ -55,7 +55,7 @@ comptime { const Float = packed union(u16) { value: f16, bits: packed struct(u16) { - mantissa: u10, + significand: u10, exponent: u5, sign: u1, }, -- cgit v1.2.3 From 1ad3534e4d276dfddefc80fcd9a2f1e6c74266d1 Mon Sep 17 00:00:00 2001 From: Chris Boesch Date: Sun, 21 Jun 2026 15:31:18 +0200 Subject: fixed grammar --- exercises/108_threading2.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'exercises') diff --git a/exercises/108_threading2.zig b/exercises/108_threading2.zig index bbf8d78..e1b35ac 100644 --- a/exercises/108_threading2.zig +++ b/exercises/108_threading2.zig @@ -46,7 +46,7 @@ // 1,000,000,000 partial values. And for each additional digit we have to // add a zero. // Even fast computers - and I mean really fast computers - get a bit warmer -// on the CPU when it comes to really many digits. But the 8 digits are +// on the CPU when it comes to a large number of digits. But 8 digits are // enough for us for now, because we want to understand the principle and // nothing more, right? // -- cgit v1.2.3 From f3df08d8e05dc0543137ae9866b389df178b97c6 Mon Sep 17 00:00:00 2001 From: Chris Boesch Date: Sun, 21 Jun 2026 15:43:28 +0200 Subject: fixed description --- exercises/115_packed2.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'exercises') diff --git a/exercises/115_packed2.zig b/exercises/115_packed2.zig index db5190a..2a772d7 100644 --- a/exercises/115_packed2.zig +++ b/exercises/115_packed2.zig @@ -51,7 +51,7 @@ comptime { // // Try to make the float below negative: -/// IEEE 754 half precision float +// IEEE 754 binary16 floating-point format const Float = packed union(u16) { value: f16, bits: packed struct(u16) { -- cgit v1.2.3 From cbcb570248a5297a0644fc22357bf81aac54545a Mon Sep 17 00:00:00 2001 From: Chris Boesch Date: Sun, 21 Jun 2026 16:16:31 +0200 Subject: expanded explanation about self vs *self --- exercises/047_methods.zig | 18 ++++++++++++++++++ patches/patches/047_methods.patch | 6 +++--- 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'exercises') diff --git a/exercises/047_methods.zig b/exercises/047_methods.zig index 3221ca2..3e88719 100644 --- a/exercises/047_methods.zig +++ b/exercises/047_methods.zig @@ -37,6 +37,24 @@ // self, others use a lowercase version of the type name, but feel // free to use whatever is most appropriate. // +// "But hold on," you say, eyeing a() and b() suspiciously, "why +// does one take 'self' and another take '*self'?" Sharp eye! +// +// It all comes down to a single question: does the function need +// to CHANGE the struct? +// +// * Needs to change it? Take a pointer (*Bar). Without it you'd +// be scribbling on a COPY, and your changes would evaporate the +// instant the function returns. Poof. +// * Only reads it? Plain Bar is just fine. +// (For a big, bulky struct you might still write *const Bar to +// avoid copying it around, but for small ones a copy is cheap.) +// +// You'll see this below: zap() takes 'self: HeatRay' by value +// because it only reads the ray's damage, but it takes the alien +// as '*Alien' because zapping is supposed to HURT - and that means +// changing the alien's health for real, not on a throwaway copy. +// // Okay, you're armed. // // Now, please zap the alien structs until they're all gone or diff --git a/patches/patches/047_methods.patch b/patches/patches/047_methods.patch index a7e8a26..4755ecb 100644 --- a/patches/patches/047_methods.patch +++ b/patches/patches/047_methods.patch @@ -1,6 +1,6 @@ ---- exercises/047_methods.zig 2023-10-03 22:15:22.122241138 +0200 -+++ answers/047_methods.zig 2023-10-05 20:04:07.056100214 +0200 -@@ -88,7 +88,7 @@ +--- exercises/047_methods.zig 2026-06-21 16:11:59.110876971 +0200 ++++ answers/047_methods.zig 2026-06-21 16:13:07.066363558 +0200 +@@ -106,7 +106,7 @@ for (&aliens) |*alien| { // *** Zap the alien with the heat ray here! *** -- cgit v1.2.3