This internship project explores whether artificial intelligence can play the tile-based game Rummikub by combining computer vision with game algorithms.
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.
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.



