From 014560c3f5cb79d6d17c0205dddcf793d0aafac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Marku=C5=A1i=C4=87?= Date: Sun, 31 May 2026 10:59:25 +0200 Subject: [PATCH 1/6] fix removed array multiplication --- exercises/110_files2.zig | 6 +++--- patches/patches/110_files2.patch | 10 +++++----- 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}); From e61bedaa25e4bc80847c4fb1508b5f4cdf35cd20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Marku=C5=A1i=C4=87?= Date: Sun, 31 May 2026 22:26:17 +0200 Subject: [PATCH 2/6] Add another defer exercise --- exercises/116_defer3.zig | 18 ++++++++++++++++++ patches/patches/116_defer3.patch | 14 ++++++++++++++ src/elrond.zig | 4 ++++ 3 files changed, 36 insertions(+) create mode 100644 exercises/116_defer3.zig create mode 100644 patches/patches/116_defer3.patch diff --git a/exercises/116_defer3.zig b/exercises/116_defer3.zig new file mode 100644 index 0000000..6e3cf6d --- /dev/null +++ b/exercises/116_defer3.zig @@ -0,0 +1,18 @@ +// +// When there are multiple defers in a single block, they are executed in reverse order. +// +const std = @import("std"); + +pub fn main() void { + var x: u32 = 100; + { + // Try reordering the statements to get the answer 42 + defer x = x / 10; + defer x = x + 11; + defer x = x * 2; + + // It might seem silly in this example, but it's important to know when + // deinitializing containers whose elements need to be deinitialized first. + } + std.debug.print("{d}\n", .{x}); +} diff --git a/patches/patches/116_defer3.patch b/patches/patches/116_defer3.patch new file mode 100644 index 0000000..7b2cce5 --- /dev/null +++ b/patches/patches/116_defer3.patch @@ -0,0 +1,14 @@ +--- exercises/116_defer3.zig 2026-05-31 22:29:56.189323732 +0200 ++++ answers/116_defer3.zig 2026-05-31 22:30:17.749186667 +0200 +@@ -7,9 +7,9 @@ + var x: u32 = 100; + { + // 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; + + // It might seem silly in this example, but it's important to know when + // deinitializing containers whose elements need to be deinitialized first. diff --git a/src/elrond.zig b/src/elrond.zig index 35c8857..311026f 100644 --- a/src/elrond.zig +++ b/src/elrond.zig @@ -1223,6 +1223,10 @@ const exercises = [_]Exercise{ .main_file = "115_packed2.zig", .output = "", }, + .{ + .main_file = "116_defer3.zig", + .output = "42", + }, .{ .main_file = "999_the_end.zig", .output = From bd55c4ac5a235778f78b91c37a0bf1516bfbcc55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luka=20Marku=C5=A1i=C4=87?= Date: Tue, 2 Jun 2026 06:11:27 +0200 Subject: [PATCH 3/6] fixup! Add another defer exercise --- exercises/028_defer2.zig | 23 +++++++++++++++++++++++ exercises/116_defer3.zig | 18 ------------------ patches/patches/028_defer2.patch | 18 +++++++++++++++--- patches/patches/116_defer3.patch | 14 -------------- src/elrond.zig | 9 ++++----- 5 files changed, 42 insertions(+), 40 deletions(-) delete mode 100644 exercises/116_defer3.zig delete mode 100644 patches/patches/116_defer3.patch diff --git a/exercises/028_defer2.zig b/exercises/028_defer2.zig index 35c1326..b490a89 100644 --- a/exercises/028_defer2.zig +++ b/exercises/028_defer2.zig @@ -10,6 +10,8 @@ pub fn main() void { for (animals) |a| printAnimal(a); std.debug.print("done.\n", .{}); + + std.debug.print("Answer to everything? {d}\n", .{calculateTheUltimateQuestionOfLife()}); } // This function is _supposed_ to print an animal name in parentheses @@ -35,3 +37,24 @@ fn printAnimal(animal: u8) void { std.debug.print("Unknown", .{}); } + +// This function is supposed to calculate the answer to the +// ultimate question of life, the universe, and everything, +// but it needs to be deferred as far in the future as possible, +// in order to gather more data. +// +// When there are multiple defers in a single block, they are executed in reverse order. +// This example might seem silly, but it's important to know when e.g. +// deinitializing containers whose elements need to be deinitialized first. +fn calculateTheUltimateQuestionOfLife() u32 { + var x: u32 = 100; + + // Try reordering the statements to get the answer 42 + { + defer x = x / 10; + defer x = x + 11; + defer x = x * 2; + } + + return x; +} diff --git a/exercises/116_defer3.zig b/exercises/116_defer3.zig deleted file mode 100644 index 6e3cf6d..0000000 --- a/exercises/116_defer3.zig +++ /dev/null @@ -1,18 +0,0 @@ -// -// When there are multiple defers in a single block, they are executed in reverse order. -// -const std = @import("std"); - -pub fn main() void { - var x: u32 = 100; - { - // Try reordering the statements to get the answer 42 - defer x = x / 10; - defer x = x + 11; - defer x = x * 2; - - // It might seem silly in this example, but it's important to know when - // deinitializing containers whose elements need to be deinitialized first. - } - std.debug.print("{d}\n", .{x}); -} 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/116_defer3.patch b/patches/patches/116_defer3.patch deleted file mode 100644 index 7b2cce5..0000000 --- a/patches/patches/116_defer3.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- exercises/116_defer3.zig 2026-05-31 22:29:56.189323732 +0200 -+++ answers/116_defer3.zig 2026-05-31 22:30:17.749186667 +0200 -@@ -7,9 +7,9 @@ - var x: u32 = 100; - { - // 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; - - // It might seem silly in this example, but it's important to know when - // deinitializing containers whose elements need to be deinitialized first. diff --git a/src/elrond.zig b/src/elrond.zig index 311026f..716f546 100644 --- a/src/elrond.zig +++ b/src/elrond.zig @@ -693,7 +693,10 @@ const exercises = [_]Exercise{ }, .{ .main_file = "028_defer2.zig", - .output = "(Goat) (Cat) (Dog) (Dog) (Goat) (Unknown) done.", + .output = + \\(Goat) (Cat) (Dog) (Dog) (Goat) (Unknown) done. + \\Answer to everything? 42 + , // pay attention to the comma }, .{ .main_file = "029_errdefer.zig", @@ -1223,10 +1226,6 @@ const exercises = [_]Exercise{ .main_file = "115_packed2.zig", .output = "", }, - .{ - .main_file = "116_defer3.zig", - .output = "42", - }, .{ .main_file = "999_the_end.zig", .output = From e69a865ce37e8fdb53273db7fd040284f42847bc Mon Sep 17 00:00:00 2001 From: Chris Boesch Date: Tue, 2 Jun 2026 11:56:34 +0200 Subject: [PATCH 4/6] fixed minor issues --- build.zig | 5 ++- src/elrond.zig | 120 ++++++++++++++++++++++--------------------------- 2 files changed, 57 insertions(+), 68 deletions(-) diff --git a/build.zig b/build.zig index b136583..29e4207 100644 --- a/build.zig +++ b/build.zig @@ -30,7 +30,7 @@ comptime { } } -// Elrond owns the entire Ziglings logic now! +// Elrond the Wise owns the entire Ziglings logic now! // build.zig only builds it and forwards the chosen options as CLI flags. // Building just this one Run step keeps the build output readable and lets // Elrond iterate without the configure-phase cache getting in the way. @@ -46,6 +46,7 @@ pub fn build(b: *Build) !void { const rand = b.option(bool, "random", "Select random exercise"); const start = b.option(usize, "s", "Start at exercise"); const reset = b.option(bool, "reset", "Reset exercise progress"); + const logo = b.option(bool, "logo", "Display Ziglings logo"); const sep = std.fs.path.sep_str; const healed_path = if (override_healed_path) |path| @@ -87,6 +88,8 @@ pub fn build(b: *Build) !void { run.addArg("--random"); } else if (start) |s| { run.addArg(b.fmt("--start={d}", .{s})); + } else if (logo) |_| { + run.addArg("--logo"); } const ziglings_step = b.step("ziglings", "Run ziglings"); diff --git a/src/elrond.zig b/src/elrond.zig index 716f546..52cf395 100644 --- a/src/elrond.zig +++ b/src/elrond.zig @@ -1,4 +1,8 @@ -// Elrond: Ziglings' exercise checker and guide. +// +// "You have a long way to go, +// and the path is not easy." +// Elrond, The Hobbit or The Fellowship of the Ring +// // // In the reworked Zig build system (configurer/maker split) a build Step no // longer carries a `makeFn`, and the configure phase is cached and not re-run @@ -33,10 +37,9 @@ pub const logo = \\ ; -// How Elrond was invoked. +// How Elrond was called. const Mode = enum { - // `zig build`: iterate from after the last solved exercise to the first - // unsolved one (or the end). + // `zig build`: iterate from after the last solved exercise to the first unsolved one (or the end). normal, // `zig build -Dn=n`: check exactly one exercise. named, @@ -57,8 +60,7 @@ pub const Exercise = struct { // main_file must have the format key_name.zig. main_file: []const u8, - // Desired output. A program passes if its output, excluding trailing - // whitespace, equals this string. + // Desired output. A program passes if its output, excluding trailing whitespace, equals this string. output: []const u8, // Optional hint shown if the program does not succeed. @@ -86,11 +88,9 @@ pub const Exercise = struct { return std.fs.path.stem(self.main_file); } - // Key of the main file: the string before the '_' with zero padding - // removed. "001_hello.zig" -> "1". + // Key of the main file: the string before the '_' with zero padding removed. "001_hello.zig" -> "1". pub fn key(self: Exercise) []const u8 { - const end_index = std.mem.indexOfScalar(u8, self.main_file, '_') orelse - unreachable; + const end_index = std.mem.indexOfScalar(u8, self.main_file, '_') orelse unreachable; var start_index: usize = 0; while (self.main_file[start_index] == '0') start_index += 1; return self.main_file[start_index..end_index]; @@ -102,11 +102,13 @@ pub const Exercise = struct { } }; +// Ansi colors. var use_color_escapes = false; var red_text: []const u8 = ""; var red_bold_text: []const u8 = ""; var red_dim_text: []const u8 = ""; var green_text: []const u8 = ""; +var yellow_text: []const u8 = ""; var bold_text: []const u8 = ""; var reset_text: []const u8 = ""; @@ -126,6 +128,7 @@ fn setupColors(io: std.Io) void { red_bold_text = "\x1b[31;1m"; red_dim_text = "\x1b[31;2m"; green_text = "\x1b[32m"; + yellow_text = "\x1b[33m"; bold_text = "\x1b[1m"; reset_text = "\x1b[0m"; } @@ -133,9 +136,9 @@ fn setupColors(io: std.Io) void { pub fn main(init: std.process.Init) !void { const io = init.io; - const gpa = init.arena.allocator(); + const arena = init.arena.allocator(); - const args = try init.minimal.args.toSlice(gpa); + const args = try init.minimal.args.toSlice(arena); setupColors(io); @@ -150,17 +153,7 @@ pub fn main(init: std.process.Init) !void { for (1..args.len) |n| { const arg = args[n]; if (std.mem.eql(u8, arg, "--logo")) { - print("{s}", .{logo}); - return; - } else if (std.mem.eql(u8, arg, "--reset")) { - std.Io.Dir.cwd().deleteFile(io, progress_filename) catch |err| switch (err) { - error.FileNotFound => {}, - else => { - print("Unable to remove progress file: {}\n", .{err}); - std.process.exit(1); - }, - }; - print("Progress reset, {s} removed.\n", .{progress_filename}); + print("{s}{s}{s}", .{ yellow_text, logo, reset_text }); return; } else if (prefix(arg, "--zig=")) |v| { zig_exe = v; @@ -188,7 +181,7 @@ pub fn main(init: std.process.Init) !void { print("{s}", .{logo}); - const ctx: Context = .{ .io = io, .gpa = gpa, .zig_exe = zig_exe, .work_path = work_path }; + const ctx: Context = .{ .io = io, .arena = arena, .zig_exe = zig_exe, .work_path = work_path }; switch (mode) { .named => { @@ -220,7 +213,7 @@ pub fn main(init: std.process.Init) !void { }, .normal => { // Start after the last solved exercise recorded in .progress.txt. - const solved = readProgress(io, gpa); + const solved = readProgress(io, arena); var start_index: usize = 0; for (exercises, 0..) |ex, idx| { if (solved < ex.number()) { @@ -245,15 +238,15 @@ fn prefix(arg: []const u8, pre: []const u8) ?[]const u8 { // Shared, read-only run context threaded through the helpers. const Context = struct { io: std.Io, - gpa: std.mem.Allocator, + arena: std.mem.Allocator, zig_exe: []const u8, work_path: []const u8, }; const Error = error{Failed}; -// Iterates exercises from `start_index` to the end, stopping at the first -// failure. Progress is written after each passed exercise. +// Iterates exercises from `start_index` to the end, stopping at the first failure. +// Progress is written after each passed exercise. fn iterateFrom(ctx: Context, start_index: usize) Error!void { for (exercises[start_index..]) |ex| { try runOne(ctx, ex, .normal); @@ -284,12 +277,12 @@ fn runOne(ctx: Context, ex: Exercise, mode: Mode) Error!void { }, } - writeProgress(ctx.io, ctx.gpa, ex.number()) catch {}; + writeProgress(ctx.io, ctx.arena, ex.number()) catch {}; } fn hintAndHelp(ex: Exercise, mode: Mode) void { if (ex.hint) |hint| - print("\n{s}Ziglings hint: {s}{s}", .{ bold_text, hint, reset_text }); + print("\n{s}{s}Ziglings hint: {s}{s}", .{ bold_text, green_text, hint, reset_text }); help(ex, mode); } @@ -313,24 +306,22 @@ fn printProgress(num: usize, max: usize) void { fn runExe(ctx: Context, ex: Exercise) !void { const io = ctx.io; - const gpa = ctx.gpa; + const arena = ctx.arena; print("Compiling {s}...\n", .{ex.main_file}); - const path = std.fs.path.join(gpa, &.{ ctx.work_path, ex.main_file }) catch - @panic("OOM"); + const path = std.fs.path.join(arena, &.{ ctx.work_path, ex.main_file }) catch @panic("OOM"); - var argv = std.ArrayList([]const u8).initCapacity(gpa, 8) catch @panic("OOM"); - defer argv.deinit(gpa); - argv.append(gpa, ctx.zig_exe) catch @panic("OOM"); - argv.append(gpa, "run") catch @panic("OOM"); + var argv = std.ArrayList([]const u8).initCapacity(arena, 8) catch @panic("OOM"); + argv.append(arena, ctx.zig_exe) catch @panic("OOM"); + argv.append(arena, "run") catch @panic("OOM"); if (ex.link_libc) { - argv.append(gpa, "-lc") catch @panic("OOM"); - argv.append(gpa, "-fllvm") catch @panic("OOM"); + argv.append(arena, "-lc") catch @panic("OOM"); + argv.append(arena, "-fllvm") catch @panic("OOM"); } - argv.append(gpa, path) catch @panic("OOM"); + argv.append(arena, path) catch @panic("OOM"); // `zig run` compiles and runs in one step using Zig's own cache. - const result = Process.run(gpa, io, .{ + const result = Process.run(arena, io, .{ .argv = argv.items, .stdout_limit = .limited(1024 * 1024), .stderr_limit = .limited(1024 * 1024), @@ -344,28 +335,27 @@ fn runExe(ctx: Context, ex: Exercise) !void { resetLine(); print("Checking {s}...\n", .{ex.main_file}); - return checkOutput(io, gpa, ex, result); + return checkOutput(io, arena, ex, result); } fn runTest(ctx: Context, ex: Exercise) !void { const io = ctx.io; - const gpa = ctx.gpa; + const arena = ctx.arena; print("Compiling {s}...\n", .{ex.main_file}); - const path = std.fs.path.join(gpa, &.{ ctx.work_path, ex.main_file }) catch + const path = std.fs.path.join(arena, &.{ ctx.work_path, ex.main_file }) catch @panic("OOM"); - var argv = std.ArrayList([]const u8).initCapacity(gpa, 8) catch @panic("OOM"); - defer argv.deinit(gpa); - argv.append(gpa, ctx.zig_exe) catch @panic("OOM"); - argv.append(gpa, "test") catch @panic("OOM"); + var argv = std.ArrayList([]const u8).initCapacity(arena, 8) catch @panic("OOM"); + argv.append(arena, ctx.zig_exe) catch @panic("OOM"); + argv.append(arena, "test") catch @panic("OOM"); if (ex.link_libc) { - argv.append(gpa, "-lc") catch @panic("OOM"); - argv.append(gpa, "-fllvm") catch @panic("OOM"); + argv.append(arena, "-lc") catch @panic("OOM"); + argv.append(arena, "-fllvm") catch @panic("OOM"); } - argv.append(gpa, path) catch @panic("OOM"); + argv.append(arena, path) catch @panic("OOM"); - const result = Process.run(gpa, io, .{ + const result = Process.run(arena, io, .{ .argv = argv.items, .stdout_limit = .limited(1024 * 1024), .stderr_limit = .limited(1024 * 1024), @@ -382,7 +372,7 @@ fn runTest(ctx: Context, ex: Exercise) !void { return checkTest(ex, result); } -fn checkOutput(io: std.Io, gpa: std.mem.Allocator, ex: Exercise, result: Process.RunResult) !void { +fn checkOutput(io: std.Io, arena: std.mem.Allocator, ex: Exercise, result: Process.RunResult) !void { switch (result.term) { .exited => |code| if (code != 0) { // `zig run` puts both compile errors and runtime panics on stderr; @@ -400,7 +390,7 @@ fn checkOutput(io: std.Io, gpa: std.mem.Allocator, ex: Exercise, result: Process } const raw_output = if (ex.check_stdout) result.stdout else result.stderr; - const output = trimLines(gpa, raw_output) catch @panic("OOM"); + const output = trimLines(arena, raw_output) catch @panic("OOM"); var exercise_output = ex.output; if (ex.timestamp) { @@ -477,28 +467,27 @@ fn resetLine() void { } // Removes trailing whitespace per line and any trailing LF at the end. -fn trimLines(gpa: std.mem.Allocator, buf: []const u8) ![]const u8 { - var list = try std.ArrayList(u8).initCapacity(gpa, buf.len); - errdefer list.deinit(gpa); +fn trimLines(arena: std.mem.Allocator, buf: []const u8) ![]const u8 { + var list = try std.ArrayList(u8).initCapacity(arena, buf.len); var iter = std.mem.splitSequence(u8, buf, " \n"); while (iter.next()) |line| { const data = std.mem.trimEnd(u8, line, " \r"); - try list.appendSlice(gpa, data); - try list.append(gpa, '\n'); + try list.appendSlice(arena, data); + try list.append(arena, '\n'); } - const result = try list.toOwnedSlice(gpa); + const result = try list.toOwnedSlice(arena); return std.mem.trimEnd(u8, result, "\n"); } // Reads the last solved exercise number from .progress.txt; 0 if absent. -fn readProgress(io: std.Io, gpa: std.mem.Allocator) u32 { +fn readProgress(io: std.Io, arena: std.mem.Allocator) u32 { const file = std.Io.Dir.cwd().openFile(io, progress_filename, .{}) catch return 0; defer file.close(io); const size = file.length(io) catch return 0; if (size == 0) return 0; - const contents = gpa.alloc(u8, size) catch return 0; + const contents = arena.alloc(u8, size) catch return 0; var file_buffer: [1024]u8 = undefined; var reader = file.reader(io, &file_buffer); const n = reader.interface.readSliceShort(contents) catch return 0; @@ -506,8 +495,8 @@ fn readProgress(io: std.Io, gpa: std.mem.Allocator) u32 { return std.fmt.parseInt(u32, trimmed, 10) catch 0; } -fn writeProgress(io: std.Io, gpa: std.mem.Allocator, number: usize) !void { - const progress = try std.fmt.allocPrint(gpa, "{d}", .{number}); +fn writeProgress(io: std.Io, arena: std.mem.Allocator, number: usize) !void { + const progress = try std.fmt.allocPrint(arena, "{d}", .{number}); const file = try std.Io.Dir.cwd().createFile( io, progress_filename, @@ -968,9 +957,6 @@ const exercises = [_]Exercise{ \\Grasshopper hopped 32 meters. , // pay attention to the comma }, - - // Skipped because of https://github.com/ratfactor/ziglings/issues/163 - // direct link: https://github.com/ziglang/zig/issues/6025 .{ .main_file = "085_async.zig", .output = "Current time: s since epoch", From 9d6ef1f5ba357bcef2a9b33640ff7f1c345988ef Mon Sep 17 00:00:00 2001 From: Chris Boesch Date: Tue, 2 Jun 2026 20:03:18 +0200 Subject: [PATCH 5/6] fixed patch file path --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 263fdbc..3d162c2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -111,7 +111,7 @@ directory. Every Ziglings exercise contains mistakes on purpose. To keep our automated tests happy, each exercise also -has a patch in `patches/healed` that “heals” it. +has a patch in `patches/patches` that “heals” it. When you change an exercise, you will usually need to update its patch too. That’s where our little helper Gollum comes in: From 01ad2961140ce9ef552532fa56923ec8d3b81f9f Mon Sep 17 00:00:00 2001 From: Chris Boesch Date: Tue, 2 Jun 2026 20:17:48 +0200 Subject: [PATCH 6/6] Elrond has moved to Rivendell (where he lives) --- build.zig | 2 +- {src => rivendell}/elrond.zig | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename {src => rivendell}/elrond.zig (100%) diff --git a/build.zig b/build.zig index 29e4207..afc1021 100644 --- a/build.zig +++ b/build.zig @@ -58,7 +58,7 @@ pub fn build(b: *Build) !void { const elrond = b.addExecutable(.{ .name = "elrond", .root_module = b.createModule(.{ - .root_source_file = b.path("src/elrond.zig"), + .root_source_file = b.path("rivendell/elrond.zig"), .target = b.graph.host, }), }); diff --git a/src/elrond.zig b/rivendell/elrond.zig similarity index 100% rename from src/elrond.zig rename to rivendell/elrond.zig