Skip to content

Commit

Permalink
feat: switch to dynamic cooldown
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesrocket committed Oct 21, 2024
1 parent e882a52 commit e9d3c63
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,19 @@ const Column = struct {
}
}

fn deactivate(self: *Column, core: *Core) void {
fn deactivate(
self: *Column,
core: *Core,
rand: std.rand.Random,
) void {
if (self.active) {
self.active = false;
self.cooldown = core.height * 2;
core.active_columns -= 1;
self.active = false;
self.cooldown =
core.height * rand.uintLessThan(
u32,
3,
);
}
}
};
Expand Down Expand Up @@ -499,7 +507,7 @@ fn printCells(
u32,
core.width,
)
].?.deactivate(core);
].?.deactivate(core, rand);

core.columns.?.items[
rand.uintLessThan(
Expand Down

0 comments on commit e9d3c63

Please sign in to comment.