Skip to content

simongalasso/n-puzzle

Repository files navigation

n-puzzle

A n-puzzle solver, made in Rust, working with an IDA* using admissible heuristics
This is a 42 school project [Final grade: 121%]


Demo


Setup

If you do not have Rust

> sh install-rust.sh

Then you can build the project

> cargo build --release

Usage

> ./target/release/n-puzzle [FLAGS] [OPTIONS]

Flags

-h, --help          Prints help information
-s, --solvable      Generates a solvable puzzle
-u, --unsolvable    Generates an unsolvable puzzle
-V, --version       Prints version information
-v, --visual        Make a visualisation of the result

Options

-f, --file <file>         Path to the file to read from
-c, --heuristic <name>    Heuristic selection, choose from 'manhattan', 'euclidian', 'hamming' and 'conflict'
-i, --iterations <nb>     The number of iterations
-n, --size <nb>           The size of the puzzle
-t, --type <type>         Alternative g(x) and f(x), choose from 'greedy' and 'uniform'

Contributors


Simon Galasso


Nicolas Viénot