Cloned Games

2048-rust

HaltedPlayableLinux

Based on 2048

About

2048 is a single-player sliding tile puzzle game written by Gabriele Cirulli and released in 2014, where the player slides numbered tiles on a grid to combine them into a tile numbered 2048. 2048-rust (published as the 'tfe' Rust crate) implements 2048's core game logic for speed rather than as a playable interface: the board is packed into a single 64-bit integer and moves are resolved via a pre-computed lookup table. The author reports it can simulate around 10 million randomly-played games in about 80 seconds across 8 threads.

How it differs from the original

Unlike a typical playable clone, it has no built-in interactive display — games are driven by a Rust closure that picks each move, making it a base for testing move-selection algorithms rather than a game played directly by hand.

Getting started

It's used as a library: add the 'tfe' crate as a dependency, then drive games programmatically through its 'Game::play' method, which repeatedly calls a supplied closure to choose the next move.

Additional notes

Credit
The author credits large parts of the board representation and algorithm to nneonneo's C++ 2048-ai project.
Share:

We’d like to use analytics cookies to understand how visitors use this site. See our Privacy Policy for details. Nothing else is tracked, and the site works the same either way.