/npuzzle

N-puzzle ("taquin" in French) game solver. 42 school project.

Primary LanguageJavaScript

N-PUZZLE

Final Mark: 121 / 121

Introduction by 42 School

The goal of this project is to solve the N-puzzle ("taquin" in French) game using the A* search algorithm or one of its variants.

It starts with a square board made up of N*N cells. One of these cells will be empty, the others will contain numbers, starting from 1, that will be unique in this instance of the puzzle.

The program search algorithm will have to find a valid sequence of moves in order to reach the final state, a.k.a the "snail solution", which depends on the size of the puzzle.

While there will be no direct evaluation of its performance in this instance of the project, it has to have at least a vaguely reasonable perfomance : Taking a few second to solve a 3-puzzle is pushing it, ten seconds is unacceptable.

Objectives

The goal of this project is to develop a N-Puzzle solver using A* algorithm.

Project has been realized using Javascript and is composed of 2 distincts parts:

  • A Command Line Interface (CLI) using Inquirer module.
  • A web client using ReactJS

Skills

  • Rigor
  • Algorithms & AI
  • Group & interpersonal

Previews

Solver 3*3 and solving settings

Solver 3*3 and solving settings screenshot

Solver 4*4 and color settings

Solver 4*4 and color settings screenshot

Eeaster Egg Animation

easter egg screenshot