Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install Zig
uses: mlugg/setup-zig@8d6198c65fb0feaa111df26e6b467fea8345e46f
with:
version: 0.13.0
version: 0.14.1

- name: Test exercises
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zig-fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Install Zig
uses: mlugg/setup-zig@8d6198c65fb0feaa111df26e6b467fea8345e46f
with:
version: 0.13.0
version: 0.14.1

- name: Check that Zig code is formatted
run: |
Expand Down
2 changes: 1 addition & 1 deletion docs/INSTALLATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Fortunately, all of the popular installation methods are listed on the [Zig inst

## Zig version

Exercism currently supports Zig 0.13.0 (released on 2024-06-07) only.
Exercism currently supports Zig 0.14.1 (released on 2025-05-21) only.

An exercise may be compatible with a different Zig version, but that isn't guaranteed.
Zig has not yet reached version 1.0, and breaking changes are common.
Expand Down
2 changes: 1 addition & 1 deletion exercises/practice/allergies/.docs/instructions.append.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

It may be helpful to look at the implementation of [`std.enums.EnumSet`][enumset].

[enumset]: https://github.com/ziglang/zig/blob/0.13.0/lib/std/enums.zig#L243-L247
[enumset]: https://github.com/ziglang/zig/blob/0.14.1/lib/std/enums.zig#L243-L247
4 changes: 2 additions & 2 deletions exercises/practice/allergies/.meta/example.zig
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ pub const Allergen = enum(u8) {
cats = 128,
};

const tag_type = @typeInfo(Allergen).Enum.tag_type;
const tag_type = @typeInfo(Allergen).@"enum".tag_type;

pub fn isAllergicTo(score: tag_type, allergen: Allergen) bool {
return score & @intFromEnum(allergen) != 0;
}

pub fn initAllergenSet(score: usize) EnumSet(Allergen) {
const len = @typeInfo(Allergen).Enum.fields.len;
const len = @typeInfo(Allergen).@"enum".fields.len;
const bits = IntegerBitSet(len){ .mask = @as(tag_type, @truncate(score)) };
return .{ .bits = bits };
}
2 changes: 1 addition & 1 deletion exercises/practice/anagram/.docs/instructions.append.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ For more details on hash maps in Zig, see:
- [Zighelp - Hash Maps][zighelp]
- [Zig Standard Library - `buf_set.zig`][buf-set]

[buf-set]: https://github.com/ziglang/zig/blob/0.13.0/lib/std/buf_set.zig
[buf-set]: https://github.com/ziglang/zig/blob/0.14.1/lib/std/buf_set.zig
[zig-hashmaps-explained]: https://devlog.hexops.com/2022/zig-hashmaps-explained/
[zighelp]: https://zighelp.org/chapter-2/#hash-maps
2 changes: 1 addition & 1 deletion exercises/practice/dnd-character/.meta/example.zig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const std = @import("std");

var prng = std.rand.DefaultPrng.init(42);
var prng = std.Random.DefaultPrng.init(42);
const random = prng.random();

pub fn ability() u8 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ For more details, see the [Zig Language Reference][zig-reference] and the implem

However, note that this exercise does not currently test an input of 0 (because `std.testing` does [not yet support expecting a panic][proposal]).

[zig-reference]: https://ziglang.org/documentation/0.13.0/#unreachable
[assert]: https://github.com/ziglang/zig/blob/0.13.0/lib/std/debug.zig#L401-L413
[zig-reference]: https://ziglang.org/documentation/0.14.1/#unreachable
[assert]: https://github.com/ziglang/zig/blob/0.14.1/lib/std/debug.zig#L536-L551
[proposal]: https://github.com/ziglang/zig/issues/1356
2 changes: 1 addition & 1 deletion exercises/practice/yacht/.meta/example.zig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const DiceInt = u3;
const Dice = [5]DiceInt;

/// Returns the sum of the items in `dice` that equal `n`.
fn sumOnly(dice: Dice, n: @typeInfo(Category).Enum.tag_type) u32 {
fn sumOnly(dice: Dice, n: @typeInfo(Category).@"enum".tag_type) u32 {
var result: u32 = 0;
for (dice) |d| {
if (d == n) result += n;
Expand Down