Skip to content

🔷 Sliding puzzle (9-puzzle) implementation in vanilla JS and CSS.

Notifications You must be signed in to change notification settings

danishmughal/sliding-puzzle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sliding-puzzle

Sliding puzzle (9-puzzle) implementation in vanilla JS and CSS.

Live Demo

A live demo for the app can be found here: A Sliding Puzzle

Features

  • Shuffle function that performs 20 valid random moves.
  • Solve function that (naively) solves the puzzle. To be improved!
  • Mobile-friendly
    • CSS translateXY() animations for mobile performance
    • Optimized for both smaller and larger screen sizes
  • Pure vanilla Javascript. No external libraries used.

Tile Behavior

Correct State


When a tile is in the correct position, it glows blue.

Incorrect State


When a tile is not in its correct final position, it glows red.

In order to win the game, the user must first shuffle the tiles and then get them back into the original order, with the bottom right tile slot unoccupied and all tiles glowing blue.

About

🔷 Sliding puzzle (9-puzzle) implementation in vanilla JS and CSS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published