All Projects โ†’ adrienball โ†’ 2048-rs

adrienball / 2048-rs

Licence: other
A rust implementation of the famous 2048 game

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to 2048-rs

open-spelling-bee
๐Ÿ Terminal-based python clone of New York Times' puzzle game "Spelling Bee"
Stars: โœญ 38 (-20.83%)
Mutual labels:  puzzle-game, terminal-game
2048-rs
Rust implementation of 2048 game
Stars: โœญ 15 (-68.75%)
Mutual labels:  2048
Data Structures For Hacktoberfest
A repository to get started with open source and contribute in Hacktoberfest . You can add any data structures and algorithms code in the language of your choice.
Stars: โœญ 16 (-66.67%)
Mutual labels:  algorithms-and-data-structures
py-problems-solutions
Implementations of various problems using Python. Dynamic Programming, BackTracking & Sorting algorithms ๐Ÿ’ป
Stars: โœญ 20 (-58.33%)
Mutual labels:  algorithms-and-data-structures
WD-Data-Structure
็Ž‹้“ใ€Šๆ•ฐๆฎ็ป“ๆž„ใ€‹2019็‰ˆ็ฎ—ๆณ•้ข˜
Stars: โœญ 13 (-72.92%)
Mutual labels:  algorithms-and-data-structures
TUMGAD
Exercise generator and helpful materials for the Introduction to Algorithms and Data Structures ๐Ÿ“š
Stars: โœญ 27 (-43.75%)
Mutual labels:  algorithms-and-data-structures
Popular Coding Questions Solution
Popular coding questions solution for interview preparation
Stars: โœญ 12 (-75%)
Mutual labels:  algorithms-and-data-structures
syzygy
A narrative meta-puzzle game
Stars: โœญ 44 (-8.33%)
Mutual labels:  puzzle-game
waterCloset
Ridiculous 2D SDL platform game
Stars: โœญ 30 (-37.5%)
Mutual labels:  puzzle-game
FreeCodeCamp-Projects
This repo is for coders who are looking to contribute & participate in Hacktoberfest. Please do star the repo if y'all liked it!
Stars: โœญ 30 (-37.5%)
Mutual labels:  algorithms-and-data-structures
pokete
A terminal based Pokemon like game
Stars: โœญ 1,397 (+2810.42%)
Mutual labels:  terminal-game
Pathfinder
A pathfinder visualizer in Flutter. Create mazes, generate random walls, or draw your own walls and see the pathfinding algorithms in action
Stars: โœญ 14 (-70.83%)
Mutual labels:  algorithms-and-data-structures
CPP-Programming
This Repository contains all types of C++ Programming Algorithms
Stars: โœญ 24 (-50%)
Mutual labels:  algorithms-and-data-structures
intro-to-java-programming
Solutions to Introduction to Java Programming by Y. Daniel Liang. 10th Edition
Stars: โœญ 91 (+89.58%)
Mutual labels:  algorithms-and-data-structures
geeks-for-geeks-solutions
โœ… My own Amazon, Microsoft and Google SDE Coding challenge Solutions (offered by GeeksForGeeks).
Stars: โœญ 246 (+412.5%)
Mutual labels:  algorithms-and-data-structures
Codewars
CodeWars Solutions (Please leave a start. Thank you)
Stars: โœญ 156 (+225%)
Mutual labels:  algorithms-and-data-structures
codility
My solutions to exercises and tests at http://codility.com.
Stars: โœญ 66 (+37.5%)
Mutual labels:  algorithms-and-data-structures
ML-ProjectKart
๐Ÿ™ŒKart of 210+ projects based on machine learning, deep learning, computer vision, natural language processing and all. Show your support by โœจ this repository.
Stars: โœญ 162 (+237.5%)
Mutual labels:  algorithms-and-data-structures
Tetris
A (incomplete) terminal Tetris. Written in Haskell.
Stars: โœญ 26 (-45.83%)
Mutual labels:  terminal-game
2048
๐ŸŽฎ 2048 clone (React/TypeScript/Redux). No canvas.
Stars: โœญ 55 (+14.58%)
Mutual labels:  2048

2048-rs

Travis Build Status

This is a Rust implementation of the famous 2048 game which runs in the terminal.

In addition to the standard user inputs, an AI can be used to perform the moves. This AI leverages the expectiminimax algorithm to recommend the best next move at each step.

Game screenshot

Statistics

Here are the statistics of the AI with its default parameters:

max tile reached frequency average time to
reach max tile
2048 100 % 12s
4096 100 % 23s
8192 96 % 74s
16384 70 % 202s
32768 10 % 673s

Average times have been computed on a macbook pro 3,5 GHz Dual-Core Intel Core i7

In particular, these statistics correspond to a minimum branch probability of 0.001. Decreasing this value would lead to better performance, as more branches would be explored, but this would also take more time.

Some other hardcoded parameters can be tweaked in order to further improve the algorithm. I have not performed an exhaustive grid search, thus the parameter set is probably sub-optimal.

Installation

Rust and cargo must be installed to run this game:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

With Cargo

cargo install play-2048

Then, in order to play:

play-2048

From source

> git clone https://github.com/adrienball/2048-rs.git
> cd 2048-rs
> cargo run --release

Usage

You can change the probability of drawing a 4 tile:

> play-2048 --proba-4 0.5

Or adjust the minimum branch probability of the expectiminimax search:

> play-2048 --min-branch-proba 0.0001

To get the list of available options, simply run:

> play-2048 --help

License

Apache 2.0/MIT

All original work licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].