core_pb::grid::computed_grid

Function validate_grid

Source
fn validate_grid(grid: &Grid) -> Result<(), String>
Expand description

Validates a Grid.

A valid Grid must satisfy the following conditions:

  • The edges of the grid must all be walls.
  • There must be no 2x2 walkable squares.
  • There must be at least one walkable space.
  • No wall should have a walkable cell either both above and below or both to the left and right