Reference · Ripple Effect rules
RippleMountOptionstype
The initial Ripple board, native progress, appearance and host event callbacks.
Import it
import type { RippleMountOptions } from "@johnmorrisdotca/kazu/ripple";
Also exported from: @johnmorrisdotca/kazu/ripple/play, @johnmorrisdotca/kazu
Definition
type RippleMountOptions = RippleDrawOptions & {
board: RippleBoard;
progress?: string;
onChange?: (game: RippleGame) => void;
onFinish?: (game: RippleGame) => void;
};
Members
| Name | Type | Description |
|---|---|---|
values (optional) | readonly number[] | undefined | |
notes (optional) | readonly (readonly number[])[] | undefined | |
errors (optional) | readonly number[] | undefined | |
selected (optional) | number | null | undefined | |
material (optional) | RippleMaterial | undefined | |
pieces (optional) | RipplePieces | undefined | |
language (optional) | RippleLanguage | undefined | |
board | RippleBoard | |
progress (optional) | string | undefined | |
onChange (optional) | ((game: RippleGame) => void) | undefined | |
onFinish (optional) | ((game: RippleGame) => void) | undefined |
Examples
import type { RippleBoard, RippleMountOptions } from "@johnmorrisdotca/kazu/ripple";
const rippleBoard: RippleBoard = {"width":9,"height":9,"rooms":[0,0,0,1,1,1,2,2,2,0,0,0,1,1,1,2,2,2,0,0,0,1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,3,3,3,4,4,4,5,5,5,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7,8,8,8,6,6,6,7,7,7,8,8,8,6,6,6,7,7,7,8,8,8],"clues":[4,null,7,9,2,null,5,null,3,null,null,3,6,7,4,8,9,2,8,null,2,1,3,null,null,null,null,7,null,1,null,6,null,null,null,9,3,8,null,5,1,7,null,null,6,2,4,6,null,9,3,7,5,1,1,null,8,null,5,null,9,2,4,null,2,null,null,null,null,null,null,null,6,null,null,2,4,null,null,3,null]};
const value: RippleMountOptions = {board:rippleBoard};
console.log(value);{
board: {
width: 9,
height: 9,
rooms: [
0, 0, 0, 1, 1, 1, 2, 2, 2, 0, 0, 0,
1, 1, 1, 2, 2, 2, 0, 0, 0, 1, 1, 1,
2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5,
3, 3, 3, 4, 4, 4, 5, 5, 5, 3, 3, 3,
4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 7, 7,
8, 8, 8, 6, 6, 6, 7, 7, 7, 8, 8, 8,
6, 6, 6, 7, 7, 7, 8, 8, 8
],
clues: [
4, null, 7, 9, 2, null, 5, null, 3, null, null,
3, 6, 7, 4, 8, 9, 2, 8, null, 2, 1,
3, null, null, null, null, 7, null, 1, null, 6, null,
null, null, 9, 3, 8, null, 5, 1, 7, null, null,
6, 2, 4, 6, null, 9, 3, 7, 5, 1, 1,
null, 8, null, 5, null, 9, 2, 4, null, 2, null,
null, null, null, null, null, null, 6, null, null, 2, 4,
null, null, 3, null
]
}
}What it prints (run when this page was built)