red6s

nQueen Solver

Feb 18th, 2017
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1. nQueenSolver is a little Java program that strategically calculates where to place N number of Queens in an N x N chess board in such a manner that no Queen is in the crosshairs of any other Queen. That is, the Queens must be placed such that they can not cause harm to any of the other Queens. When a solution for a value of N does not exist, the program exits with a "No Solution" message. This program implements backtracking using recursion. For large values of N, it could take a long time to generate a solution. I have tested it for values of N from 1 to 15. USAGE: java nQueenSolver [SIZE] [RowQ1] [ColQ1] SIZE : Size of the chess board (i.e. N) RowQ1, ColQ1 : Co-ordinates where you want the first Queen to be placed Author: xyberz09 WARNING: Extremely ugly code. Proceed at your own risk.
  2.  
  3. DOWNLOAD FULL FROM HERE :
  4.  
  5. http://adf.ly/1k6O9S
Add Comment
Please, Sign In to add comment