Reference · Mazes, arrows and mixed boards
liftMazefunction
The finger lifted. A stroke that changed nothing is forgotten, so Undo never has a step that did nothing.
Import it
import { liftMaze } from "@johnmorrisdotca/meikyuu";
Definition
function liftMaze<M extends MazeCore>(game: MazeGame<M>): MazeGame<M>
Parameters
| Name | Type | Description |
|---|---|---|
game | MazeGame<M> | The current immutable native game state. |
Returns
MazeGame<M>
The finger lifted. A stroke that changed nothing is forgotten, so Undo never has a step that did nothing.
Examples
import type { MazeRecipe } from "@johnmorrisdotca/meikyuu";
import { buildMaze, liftMaze, newMazeGame, pressMaze } from "@johnmorrisdotca/meikyuu";
const recipe: MazeRecipe = {shape:"square",w:5,h:5,algorithm:"backtracker",mode:"to-goal",seed:42};
const maze = buildMaze(recipe);
const game = newMazeGame(maze);
console.log(liftMaze(pressMaze(game,maze.start)).drawing);falseWhat it prints (run when this page was built)