orientCellsfunction
The piece turned turns quarter turns and, if asked, mirrored — the shape a player has in hand.
Import it
import { orientCells } from "@johnmorrisdotca/narabe";
Definition
function orientCells(piece: Piece, turns: number, flipped: boolean): PieceCell[]
Parameters
| Name | Type | Description |
|---|---|---|
piece | Piece | The queued piece with relative coloured cells. |
turns | number | The number of clockwise quarter turns. |
flipped | boolean | Whether to reflect the piece before rotating it. |
Returns
PieceCell[]
The piece turned turns quarter turns and, if asked, mirrored — the shape a player has in hand.
Examples
import { orientCells } from "@johnmorrisdotca/narabe";
console.log(orientCells({cells:[{row:0,col:0,stone:"black"},{row:0,col:1,stone:"white"}]},1,false));[
{ row: 0, col: 0, stone: 'black' },
{ row: 1, col: 0, stone: 'white' }
]What it prints (run when this page was built)