Skip to content

Commit

Permalink
description improved for cell.add
Browse files Browse the repository at this point in the history
  • Loading branch information
ardauzan committed Dec 26, 2024
1 parent 9d3f8d7 commit 9ded20f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/grid.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ pub fn is_empty(grid: Grid) -> Bool {
}

/// Add cell to grid.
/// If the cell conflicts with another cell in the grid, the cell will not be added.
/// If the cell is already in the grid, it will not be added.
/// If the cell is dead, it will not be actually added.
pub fn add(grid: Grid, cell: cel.Cell) -> Grid {
case cel.is_alive(cell), cell_conflicts(grid, cel.toggle(cell)) {
True, True -> grid
Expand Down

0 comments on commit 9ded20f

Please sign in to comment.