Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zig: bump to master (0.14) #2

Closed
wants to merge 3 commits into from
Closed
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/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build
on: [push, pull_request]
env:
zig_version: 0.12.0
zig_version: 0.13.0

jobs:
build:
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
zig-cache/
zig-out/
.zig-cache/
zig-out
12 changes: 6 additions & 6 deletions src/minesweeper/game.zig
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub const GameState = struct {
extent: u32_2,
mine_count: u32,
board: [][]CellState,
rng: std.rand.Xoroshiro128, // Hardcode PRNG type for forward compatibility
rng: std.Random.Xoroshiro128, // Hardcode PRNG type for forward compatibility
is_first_move: bool = true,
is_ended: bool = false,
flag_count: u32 = 0,
Expand All @@ -63,16 +63,16 @@ pub fn cell_at(game: *GameState, position: u32_2) *CellState {
// I borrowed this name from HLSL
fn all(vector: anytype) bool {
const type_info = @typeInfo(@TypeOf(vector));
assert(type_info.Vector.child == bool);
assert(type_info.Vector.len > 1);
assert(type_info.vector.child == bool);
assert(type_info.vector.len > 1);

return @reduce(.And, vector);
}

fn any(vector: anytype) bool {
const type_info = @typeInfo(@TypeOf(vector));
assert(type_info.Vector.child == bool);
assert(type_info.Vector.len > 1);
assert(type_info.vector.child == bool);
assert(type_info.vector.len > 1);

return @reduce(.Or, vector);
}
Expand Down Expand Up @@ -113,7 +113,7 @@ pub fn create_game_state(allocator: std.mem.Allocator, extent: u32_2, mine_count
return GameState{
.extent = extent,
.mine_count = mine_count,
.rng = std.rand.Xoroshiro128.init(seed),
.rng = std.Random.Xoroshiro128.init(seed),
.board = board,
.event_history = event_history,
.children_array = children_array,
Expand Down
Loading