Skip to content
mhwombat edited this page Jun 27, 2013 · 1 revision

UnboundedSquareGrid is an infinite, unbounded, grid filled with square tiles. The indexing scheme is illustrated below.

Unbounded grid with square tiles

rectSquareGrid r c returns a rectangular grid with r rows and c columns, using square tiles. Depending on whether the number of rows and columns is even or odd, the centre of the grid may consist of one, two, or four tiles.

Rectangular grid with square tiles

torSquareGrid r c returns a toroidal grid with r rows and c columns, using square tiles. The indexing scheme is illustrated below. A toroidal grid has no boundary, and no defined centre.

Toroidal grid with square tiles

Clone this wiki locally