Skip to main content
  • Internship report
  • Research

Internship report: can an AI play Rummikub?

An internal project exploring whether AI can play Rummikub by combining computer vision with Monte Carlo Tree Search: early results and lessons.

Apr 1, 2021By Sander Backx, Thomas More Geel
The Rummikub app with tiles on the board

This internship project explores whether artificial intelligence can play the tile-based game Rummikub by combining computer vision with game algorithms.

01

From screen capture to board state

The project used the official Rummikub app as a game platform, capturing screen sections with Python's Pillow library. OpenCV filtering extracted game elements and created contours to identify individual tiles.

Two separate predictions occurred for each tile: digit recognition using a K-Nearest Neighbours algorithm (values 0-13, with 0 for jokers), and colour detection through RGB analysis using K-Means clustering.

02

Monte Carlo Tree Search for optimal moves

Monte Carlo Tree Search simulated possible game states to determine optimal moves. The algorithm evaluated action sequences using a reward function: 100 points for player victory, move count plus 0.5 for ongoing games, and 0 for opponent victories.

Once the board state was reconstructed from the vision pipeline, the algorithm could explore possible moves and select the most promising strategy.

Want to work together

Project in mind?

Start with a conversation, or with the readiness check. Either way, you talk to the people who build it.