summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Boesch <chrboesch@noreply.codeberg.org>2026-06-01 20:50:08 +0200
committerChris Boesch <chrboesch@noreply.codeberg.org>2026-06-01 20:50:08 +0200
commitac9f96459ce1ce2c1cec5605cf6075d0fbf559b7 (patch)
treecf8b1c633d4633b4d7a8889d53f3fb22c6c2b767
parent4ce3ed23f3f01125fb233e91240bcc793ba6d46c (diff)
parent014560c3f5cb79d6d17c0205dddcf793d0aafac2 (diff)
Merge pull request 'fix removed array multiplication' (#436) from mark2185/exercises:array_mult into main
Reviewed-on: https://codeberg.org/ziglings/exercises/pulls/436
-rw-r--r--exercises/110_files2.zig6
-rw-r--r--patches/patches/110_files2.patch10
2 files changed, 8 insertions, 8 deletions
diff --git a/exercises/110_files2.zig b/exercises/110_files2.zig
index 9dfaf05..c4cce08 100644
--- a/exercises/110_files2.zig
+++ b/exercises/110_files2.zig
@@ -36,10 +36,10 @@ pub fn main(init: std.process.Init) !void {
const file = try output_dir.openFile(io, "zigling.txt", .{});
defer file.close(io);
- // 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');
// this should print out : `AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA`
std.debug.print("{s}\n", .{content});
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});