Circular Board¶
Usage¶
import {newBoard} from 'mazes101/boards/circular';
let board = newBoard({radius: 7});
import {newFromBaseBoard} from 'mazes101/boards/circular';
let board = newFromBaseBoard(baseBoard, {radius: 7});
Anatomy¶
Size Parameters¶
A rectangular board has two size parameters:
radius
: ItsinnerRadius
Position¶
Position of each cell is represented by polar coordinates where:
r
is rth row from center, starts from first visible rowt
is nth cell in rth row
Directions¶
Each cell in a rectangular board utilizes 4 directions as following:
- Top clockwise (mask:
0b00001
or1
) - Top counter-clockwise (mask:
0b00010
or2
) - Right (mask:
0b00100
or4
) - Bottom (mask:
0b01000
or8
) - Left (mask:
0b10000
or16
)
If there is only one top cell it will be considered in top clockwise direction.