Skip to content

akinguyen/NQueenProblem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

N-Queen Problem

This respository contains the Javascript solution for the N-Queen problem. The current solution utilizes the BFS concept and will be updated with A* algorithm.

  • See the result by simply running node main.js
  • See different n solution by modifying var solution = new Solution(4) into var solution = new Solution(n); inside main.js

The online animation demo for the N-Queen (BFS approach) is on my CodePen dashboard:

https://codepen.io/akiara-nguyen/pen/ywKegm?editors=0110

Example result outputted on the console after running the main.js:

4x4:

* Q * *
* * * Q
Q * * *
* * Q *

5x5:

* Q * * *
* * * Q *
Q * * * *
* * Q * *
* * * * Q

6x6:

* Q * * * *
* * * Q * *
* * * * * Q
Q * * * * *
* * Q * * *
* * * * Q *

7x7:

* Q * * * * *
* * * * * * Q
* * * * Q * *
* * Q * * * *
Q * * * * * *
* * * * * Q *
* * * Q * * *

8x8:

* Q * * * * * *
* * * Q * * * *
* * * * * Q * *
* * * * * * * Q
* * Q * * * * *
Q * * * * * * *
* * * * * * Q *
* * * * Q * * *

About

Solution for the classic NxN Queen problem

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published