This is a solver for Rummikub.
Don't know whether there is a winning move? Someone can't finish, has made a mess on board, and can't retrieve original sets? Don't worry! Rummikub Solver automatically finds the solution.
Rummikub Solver uses integer linear programming to find the solution which maximizes the number of tiles placed on the table from the rack. You just need to provide the current description of the state of the game. Rummikub Solver will display possible sets that are achievable and tiles that may be placed to achieve them.
This section explains how you can install this application. You have two options:
- Fetch a prebuilt package.
- Build from source.
For Linux & Windows, you may fetch a compiled package from the releases tab.
For Linux, you will additionally need to install GLPK (see the "GLPK" section below) to execute the included binary. Windows comes with the necessary DLLs bundled in the zip archive.
Rummikub Solver requires GLPK for compilation and execution. Here are package pointers to some selected platforms:
OS | Package |
---|---|
Ubuntu | libglpk-dev |
Arch Linux | glpk |
MacOS | Homebrew GLPK |
Windows (Msys2) | mingw-w64-x86_64-glpk |
Firstly, install a Haskell toolchain. This can be easily done with GHCup.
Secondly, use Stack to build & install the package with:
stack build
stack install
Shortly, run rummikubsolver
and go to https://127.0.0.1:8080
.
Rummikub Solver has 2 UIs available: CLI and GUI. GUI is turned on by default
and uses threepenny-gui
to run a web interface. To use the GUI, visit 127.0.0.1:8080
.
You can run Rummikub Solver after installation by executing rummikubsolver
.
Both interfaces use special syntax for adding or removing tiles from the table or the rack. For example:
-lr1-3 // Remove (-) blue (l) and red (r) tiles of value from 1 to 3.
y10 // Add a yellow (y) 10 tile
j // Add a joker (j)
-j, b2 // Remove a joker (j) and add black (b) 2.
Formally the queries have following syntax:
QUERY ::= [-] (COLOR+ (VALUE | VALUE_RANGE) | j)
COLOR ::= [rlyb]
VALUE ::= 1-13
VALUE_RANGE ::= VALUE - VALUE
The solver in this software is based on "Solving Rummikub Problems by Integer Linear Programming" by D. Den Hertog and P. B. Hulshof.
This program was done to train my Rummikub skills and as a helping tool for board game nights.