Reference · Mazes, arrows and mixed boards
clearStonesfunction
Every stone taken up, in one step Undo can put back. The same game when there are none.
Import it
import { clearStones } from "@johnmorrisdotca/meikyuu";
Definition
function clearStones<M extends MazeCore>(game: MazeGame<M>): MazeGame<M>
Parameters
| Name | Type | Description |
|---|---|---|
game | MazeGame<M> | The current immutable native game state. |
Returns
MazeGame<M>
Every stone taken up, in one step Undo can put back. The same game when there are none.
Examples
import type { MazeRecipe } from "@johnmorrisdotca/meikyuu";
import { buildMaze, clearStones, newMazeGame } from "@johnmorrisdotca/meikyuu";
const recipe: MazeRecipe = {shape:"square",w:5,h:5,algorithm:"backtracker",mode:"to-goal",seed:42};
const maze = buildMaze(recipe);
const stoneGame = newMazeGame(maze,{limit:5,reach:1});
console.log(clearStones(stoneGame).stones);[]What it prints (run when this page was built)