Skip to content

mukeshgurpude/queens-problem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

N Queens Problem

N - Queens problem is to place n queens in such a manner on an n x n chessboard that no queens attack each other by being in the same row, column or diagonal.

How to run

$ python3 main.py <board-size>

Example

$ python3 main.py 3
  No solution found

$ python3 main.py 4
  -----------------
  |   | 1 |   |   |
  -----------------
  |   |   |   | 1 |
  -----------------
  | 1 |   |   |   |
  -----------------
  |   |   | 1 |   |
  -----------------

About

Implementation of N-Queens problem in Python

Topics

Resources

Stars

Watchers

Forks