Skip to content

jinsuichen/8-puzzle-visualization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

Deployment: https://jinsuichen.github.io/8-puzzle-visualization/

This is a visualization of 8 puzzle problem with A* algorithm using html, css, javascript. The project uses javascript to implement the priority queue and the A* algorithm. Animations are implemented using native html and css.

Features

Customize start and end states

You can customize the start and end states and the program can react correctly to any state.

Randomly set start and end states

For demonstration purposes, you can click the "Random" button to get a random set of start and end states.

Illegal status detection

If you enter a status that is illegal, the program will alert for it.

Determining the no solution situation

The algorithm will determine whether the set of states has a solution based on the inverse pair of the starting and ending states. If there is no solution, an alert will be given.

Pathfinding process with animation

For a set of states, the program calculates how to operate to get from the start one to the end one in the shortest steps. And it will show it in the form of an animation.

About

A visualization of 8 puzzle problem with A* algorithm using html, css, javascript

Resources

License

Stars

Watchers

Forks