macOS ◆ xterm-256color ◆ zsh 509 views

Monte Carlo Tetris Playing.

The task at this year’s International Contest in Functional Programming was to write an AI for a Tetris-like game, played on a hexagonal board. In this ASCIIcast, you see our submission playing on a laptop, with a 2.5 minutes time limit.

Our approach is based on Monte Carlo Tree Sampling: for each move, the AI generates a number of random playouts. Each playout is a sequence of (mostly random) moves until the end of the game. At the end, the AI evaluates the score corresponding to this playout, and propagates that information to the current game position. Once it did as many playouts as time allows, it chooses the move that looked most interesting.