Skip to content

benmandrew/rose

Repository files navigation

Rose

Visualiser for Solitaire game graphs. You can interact with it online here.

Screenshot

Run with Docker

Set the timeout to whatever you wish; the performance of the webpage is proportional to the graph size, so if it's too slow, drop this lower to get a smaller graph.

BFS_TIMEOUT_S=0.1 docker compose up

Access the web app on http://localhost:8080.

By default, the graph will be explored by a breadth-first search (BFS) until the timeout. Alternatively, by setting WITH_DFS=true as below, it will first explore down a single path, depth-first, using a simple heuristic for the best move in each state. Once no more moves can be made, the BFS is done from every node in the path. Using this heuristic makes it possible to find the winning state, which will be labelled if found.

WITH_DFS=true BFS_TIMEOUT_S=0.1 docker compose up

Search algorithm

Set ALGORITHM to choose how the graph is explored (within the same depth/timeout budget):

  • bfs (default) — breadth-first search; explores every state level by level.
  • bestfirst — greedy best-first search ordered by a state heuristic (foundation progress, face-down cards, blocked cards, and free columns), biasing exploration toward promising states.
  • astar — A* search ordered by depth plus an admissible foundation-distance heuristic, reaching winning states along shorter paths first.
ALGORITHM=astar BFS_TIMEOUT_S=0.1 docker compose up

WITH_DFS=true takes precedence over ALGORITHM. All three algorithms build the complete state graph for visualisation; they differ only in which states they expand first when the budget is limited.

Build locally

With Nix (recommended)

A flake.nix provides a dev shell with every tool the build needs (cmake, clang, cppcheck, cpplint, node/npm, fmt), pinned via flake.lock for reproducibility.

$ nix develop

Run any of the commands below inside that shell.

Without Nix

Depends on:

  • cmake
  • a C++23 compiler (gcc or clang)
  • npm
  • cpplint and cppcheck (for the lint target)
  • clang-format (for the format target)

Build

$ mkdir build
$ cd build
$ cmake ..
$ cmake --build .

Or with CMake presets (also used by CI):

$ cmake --preset release
$ cmake --build --preset release

Run Tests

cmake --build . --target tests

Lint

cmake --build . --target lint

Format

cmake --build . --target format

About

Visualiser for Solitaire game graphs

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors