Skip to content
/ puzzle Public

a variation of the 8-puzzle called 11d-puzzle

License

Notifications You must be signed in to change notification settings

pbgnz/puzzle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

puzzles

Requirements

  1. Go 1.7 or later

Details

Assume a variation of the 8-puzzle called 11d-puzzle. The 11d-puzzle is identical to the 8-puzzle, except for 2 differences:

  1. the board is a 3x4
  2. diagonal moves into the empty tile are legal (assume it can be done on a physical board). So we have at most 8 possible moves: UP , UP – RIGHT , RIGHT , DOWN – RIGHT , DOWN , DOWN – LEFT , LEFT , UP – LEFT . The goal configuration of the 11d-puzzle is:
+---+---+---+---+
| 1 | 2 | 3 | 4 |
+---+---+---+---+
| 5 | 6 | 7 | 8 |
+---+---+---+---+
| 9 | 10| 11| 0 |
+---+---+---+---+

Usage

$ go get -u github.com/pbgnz/puzzle
$ puzzle 1 0 3 7 5 2 6 4 9 10 11 8