perplexity-cli
🧠 A simple command-line client for the Perplexity API. Ask questions and receive answers directly from the terminal! 🚀🚀🚀
A rust implementation of the famous 2048 game
git clone https://github.com/adrienball/2048-rs.gitadrienball/2048-rsThis 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.
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.
Rust and cargo must be installed to run this game:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
cargo install play-2048
Then, in order to play:
play-2048
> git clone https://github.com/adrienball/2048-rs.git > cd 2048-rs > cargo run --release
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
All original work licensed under either of
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.
more like this
🧠 A simple command-line client for the Perplexity API. Ask questions and receive answers directly from the terminal! 🚀🚀🚀
TachiSnap — Pixel Snapper for animation pixel artists. Rust + WebAssembly client-side tool for cleaning up AI-generated…
Pathfinding library for calculating all node pairs' shortest paths in an unweighted undirected graph.
search projects, people, and tags