tools-2048-rs
A Rust crate that provides the core logic of the popular game 2048, along with a basic AI to play the game.
Example
use Game2048;
let mut game: Game2048 = new; // create a new game
// make 10 moves
for _ in 0..10
// make a move based on the AI's best move
game.make_move;
assert!; // the score should be greater than 0
assert!; // the game should not be over yet
The AI is based on the Monte Carlo algorithm, and uses parallelism to speed up the process.