Crates.io | puzzle-lib |
lib.rs | puzzle-lib |
version | 0.2.0 |
source | src |
created_at | 2024-07-21 12:18:14.120955 |
updated_at | 2024-08-10 04:36:00.01057 |
description | 数字华容道 核心库 |
homepage | https://github.com/initialencounter/puzzle |
repository | https://github.com/initialencounter/puzzle |
max_upload_size | |
id | 1310263 |
size | 6,761 |
A library for puzzle games.
// import the library
use puzzle_lib::Puzzle;
fn main() {
let puzzle = Puzzle::new(3, 3);
// show the puzzle
for i in 0..3{
println!("{:?}", puzzle.puzzle[i]);
}
println!();
// move the tile to the up
puzzle.move_tile('U');
// show the puzzle
for i in 0..3{
println!("{:?}", puzzle.puzzle[i]);
}
}