Skip to content

neeraj08/NPuzzle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPuzzle

The popular N Puzzle game

alt tag

Goal: To put numbers in sorted order from left to right and then top to bottom. e.g. for 4 X 4 grid the desired state would be

1 2 3 4

5 6 7 8

9 10 11 12

13 14 15 _

** You can change grid size by changing variable n in NPuzzle.java

Operations possible: only 1.)Swap the empty cell with adjacent cell(right, left, top, bottom) by clicking on the adjacent cell.

Color coding: Green indicates the number is in its correct position. Yellow indicates the number is the smallest misplaced number in the desired goal state. Red indicates the number is in wrong position.

When all numbers go green you have won the game!

Have fun!

About

The popular N Puzzle game written in Java

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages