8 Commits

Author SHA1 Message Date
209beef484 feat: README 2025-05-03 11:42:18 +02:00
3c73ccab96 feat: add Cell entities class
This class provides a basic structure for creating "player" entities,
storing their neighboring cells and applying them to the grid arena.
2025-05-03 10:00:46 +02:00
40e391b426 fix(count, display): swapped x/y and i/j coordinates
- count: fixed (i, j) mixup and added >= 0 to both bounds check
- generation: swapped HEIGHT and WIDTH in loop order
2025-05-03 07:28:48 +02:00
b053bbcbeb feat: add generation function
This commit adds the generation function, which:
 - Takes the current grid arena as input.
 - Creates a new temporary grid.
 - Applies Conway's Game of Life rules to compute the next state.
 - Replaces the original grid with the updated one.

Conway's Game of Life rules:
 - A live cell dies if it has fewer than 2 or more than 3 live neighbours.
 - A live cell survives if it has 2 or 3 live neighbours.
 - A dead cell becomes alive if it has exactly 3 live neighbours.
2025-05-01 22:05:06 +02:00
2176502bd7 feat: add count function
It introduces a new `count` function that take:
- the grid arena
- X and Y as `isize`

It counts how many nearby cells are alive at a specified position and returns the total.
2025-05-01 21:48:08 +02:00
f09f0efb7b feat: add display function
This commit introduces a new `display` function:
- It takes an immutable reference to a grid of bool values
- It takes mutable reference to a String buffer.

it writes to the buffer, `X` or `.` depending on the grid's bool element.
2025-05-01 09:29:47 +02:00
f128e3554c chore: cargo init task 2025-04-29 22:40:38 +02:00
Loïc GUEZO
3067b52d20 Initial commit 2025-04-29 22:35:29 +02:00