ZackChOfficial / n-puzzle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

N-puzzle

42 school project requires solving n-puzzle game with A* and similar algorithms, click this link for more info.

Demo

the project includes a web interface to experiment and play with, you can visit it here.

Features

  • solving 3*3 and 4*4 boards with optimal speed.
  • using different algorithms
    • A*
    • IDA*
  • using multiple heuristic functions
    • manhattan distance
    • linear conflict
    • disjoint pattern database
  • web api to visualize and experiment with the program.

theoretically the program can solve any bord size (n-puzzle), but in practice it will be to slow for boards bigger or equal to 5*5.

Requirements

cmake, g++ or clang++

all those programs must be added to your path

Instalation

git clone https://github.com/ZackChOfficial/n-puzzle.git
cd n-puzzle
./utils/configure.sh && ./utils/build.sh

Running web interface localy

Requirements :

node, npm, emscripten

cd web/public/wasm/
./configure.sh && ./build.sh 
cd ../..
npm install
npm start

or you can visit it online at this link.

Usage

the program reads the board from the standard input and prints a bunch of useful data. example :


Type :

./buils/n-puzzle -h # for more info about usage

Contributors

License

MIT

About


Languages

Language:C++ 54.7%Language:JavaScript 34.5%Language:Python 5.4%Language:CMake 2.3%Language:CSS 1.4%Language:HTML 1.3%Language:Shell 0.3%