Reference · Rules, solvers and generation
transformedfunction
A layout code turned or mirrored: turn quarter turns, then a mirror across the vertical when mirror. Its walls turn with it.
Import it
import { transformed } from "@johnmorrisdotca/tsunagi";
Definition
function transformed(code: string, size: number, turn: number, mirror: boolean): string
Parameters
| Name | Type | Description |
|---|---|---|
code | string | The native layout, answer or line-progress string. |
size | number | The number of cells on each side of the board. |
turn | number | The number of quarter turns. |
mirror | boolean | Whether to reflect the board. |
Returns
string
A layout code turned or mirrored: turn quarter turns, then a mirror across the vertical when mirror. Its walls turn with it.
Examples
import { TSUNAGI_4 } from "@johnmorrisdotca/tsunagi/levels-4";
import { transformed } from "@johnmorrisdotca/tsunagi";
const givens = TSUNAGI_4[0][0];
console.log(transformed(givens,4,1,true));ABCD........ABCDWhat it prints (run when this page was built)