Skip to main content

Rummikub solver console with multi-game support and persistence.

Project description

Rummikub Console

A Rummikub solver console supporting multiple games and persistence, written in Python.

The algorithm used builds on the approach described by D. Den Hertog, P. B. Hulshof (2006), "Solving Rummikub Problems by Integer Linear Programming", The Computer Journal, 49(6), 665-669 (DOI 10.1093/comjnl/bxl033).

Features

  • Can track multiple games, letting you switch between named games
  • Saves tracked games automatically
  • Can work with different Rummikub rules, letting you adjust the number of colours, tiles, and other aspects
  • You can freely adjust what tiles are on the rack or on the table, within the limits of what tiles are available according to the current rules

Solver improvements

The original models described by Den Hertog and Hulshof assume that all possible sets that meet the minimum length requirements and can't be split up are desirable outcomes.

However, any set containing at least one joker which is longer than the minimal run in effect contains a redundant joker, something you wouldn't want to leave on the table for the next player to use. In this implementation, such sets are omitted from the possible options.

The implementation also includes a solver for the initial move, where you can only use tiles from your own rack and must place a minimum amount of points before you can use tiles already on the table. This solver is a variant of the original solver that maximizes tiles placed, but is constrained by the minimal point amount and disregards jokers (which means jokers are only used for the opening meld if that is the only option available).

Install

You can install this project the usual way:

$ pip install RummikubConsole

or use a tool like pipx to help you manage command-line tool installations like these:

$ pipx install RummikubConsole 

Development

The source code for this project can be found on GitHub.

When running locally, install Pipenv, then run:

pipenv install
pipenv run rsconsole

to run the console solver.

Usage

Run the rsconsole command-line tool to open the console, or run rsconsole --help to see how you can adjust the Rummikub rules (you can adjust tile count, colours, joker count, the minimum number of tiles to make a set and the minimum score for the initial placement).

You then enter the console command loop. Enter ? or h or help to list the available commands, and help <command> to get help on what each command does.

Credits

The initial version of the solver and console were written by Ollie Hooper.

This version is a complete rewrite by Martijn Pieters, with new console implementation, expansion of the solver to improve performance and address shortcomings in the original paper, as well as multi-game, game state tracking and persistence support.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

RummikubConsole-1.0.0.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

RummikubConsole-1.0.0-py2.py3-none-any.whl (19.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file RummikubConsole-1.0.0.tar.gz.

File metadata

  • Download URL: RummikubConsole-1.0.0.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for RummikubConsole-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c9f11f0e0ff931fa8380ae77d8d26eb7da2ccbc6fd2b44bcb4eb182a80d64a9e
MD5 8f2baf9a98844dd482d128bb5c769811
BLAKE2b-256 a0d91213498db43cc13b2e322d0d8b94288c4df436638c100498db679eca1f9a

See more details on using hashes here.

File details

Details for the file RummikubConsole-1.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: RummikubConsole-1.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for RummikubConsole-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b0b3ddc6db591893a5f9e8bd19551c2eea63ff1dcfe129eb5ef857a9497de9fc
MD5 6d600bddcfd06e768ceefb15ed4ba273
BLAKE2b-256 48b156174480957147cd72004656e857d66159df895b3a3bc9074b31bf893b94

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page