| Crates.io | akioi-2048 |
| lib.rs | akioi-2048 |
| version | 0.5.0 |
| created_at | 2025-09-13 10:53:01.86772+00 |
| updated_at | 2025-09-13 11:30:00.481765+00 |
| description | A 2048 engine with multiplier tiles |
| homepage | https://github.com/jasonxue1/akioi-2048-rust |
| repository | |
| max_upload_size | |
| id | 1837539 |
| size | 1,176,571 |
Pure Rust 2048 engine with multiplier tiles and score tracking.
65536 tile) and game overinit() -> [[i32; 4]; 4]Create a new 4x4 board with two starting tiles.
step(board: [[i32; 4]; 4], dir: Direction) -> Result<([[i32; 4]; 4], i32, State), String>(new_board, delta_score, state)state is an enum: State::{Victory, GameOver, Continue}.Direction::{Up,Down,Left,Right} for dir.use akioi_2048::{init, step, Direction, State};
fn main() {
let board = init();
let (next, delta, state) = step(board, Direction::Down).unwrap();
println!("delta={delta}, state={state:?}, next={next:?}");
}
This library is intended to be published to crates.io. See .github/workflows/publish.yml.