Skip to content

Grid

[Source]

A 2D rectangle of styled cells. Immutable for safe passing between actors. Row-major layout: index = (row * width) + col.

class val Grid

Constructors

filled

[Source]

Create a grid where every cell is fill.

new val filled(
  width': USize val,
  height': USize val,
  fill: Cell val)
: Grid val^

Parameters

Returns


Public fields

let width: USize val

[Source]


let height: USize val

[Source]


Public Functions

apply

[Source]

Look up a cell by (col, row). Returns GridCellOutOfBounds if out of range.

fun box apply(
  col: USize val,
  row: USize val)
: (Cell val | GridCellOutOfBounds val)

Parameters

Returns