Code Monkey home page Code Monkey logo

rummibot's Introduction

rummibot (working title)

rummibot is a rummikub solver

The 13 tiles in 4 colors are represented as integers from 1 to 52 in this implementation. Jokers are represented by 0. There are two of each tile. Runs can be constructed by comparing size, just one comparison, as opposed to both size and color.

Groups will all have the same modulo 13 as the other members of the group. Note that care must be taken to not confuse 0, Jokers, with 13 % 13, the black 13 tiles, mainly in the context of printing to the stdout.

Current goal is to use a greedy algorithm to create as many valid runs/groups per turn. Future revision may include withholding tiles for strategic purposes.

The initial meld and each subsequent turn are functionally identical problems, so they can be solved with the same algorithm. However, they have different constraints: the initial meld must sum to over 30, while subsequent turns must use all the tiles on the table and at least one from the player's hand.

Glossary

  • set - a run or group
  • run - 3 or 4 tiles of the same number, all diffrent colors
  • group - 3 or more tiles in ascending order, all same color
  • initial meld - first turn, sum of points must be at least 30
  • hand - also called rack, tiles
  • table - sets placed on by players on their turn

Usage

No arguments or options currently.

python rummibot.py

Features

Current

  • Colored tiles
  • Game setup
  • Select initial valid meld from hand

Future

  • Backtracking
  • Count cards (tiles?)
  • Count each players remaining tiles
  • Solve user inputed games
  • Plot and scheme

Moonshots

  • Tile shuffling animation
  • Easy to use GUI/TUI
  • Rewrite in hylang

rummibot is a work in progress


See also:

rummibot's People

Contributors

gsobell avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.