Skip to content

cammarosano/n_queens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

n_queens

A small program that outputs the solutions to the n_queens problem.

But... WHY ???

Because it uses the AWESOME backtracking algorithm! (yep, just for fun)

Usage

compile: gcc n_queens.c -o queenie
run: ./queenie N, where N is the chessboard size (1 to 16)
Obs: N values higher than 13 will take a while to solve...

Output interpretation

From left to right: The first digit represents the position of the first queen in the first column (index starting at 0).
The n-th digit represents the position of the n-th queen in the n-th column.
Index ranges from 0-9 then A-F.

Example:
The output of ./queenie 4 is:

1302
2031
number of solutions: 2

The first solution, 1302, represents the following:
n_queens

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages