Skip to content

The task is to count the number of pieces combinations when none of them capture another

Notifications You must be signed in to change notification settings

saylenty/Eight-queens-enhanced

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Eight-queens-enhanced

Algorithm solves the problem of the chess pieces placement on a chess board in a way they can't capture each other. This is a kind very well known puzzle Eight queens but with other chess pieces involved.

Implantation details

The main idea of this algorithm is to try every possible combination of calculated pieces places until the correct answer(s) is found. We focus on finding the number of possible placements. This is a recursive algorithm with backtracking approach.

Algorithm works like demonstrated below, but additional chess pieces available.

Algorithm visualization

Available solvers

  1. Java single-thread approach - uses recursive backtracking algorithm

Available visualization

  • Java implementation has a console output which indicates the number of possible combinations and the placement of figures in each found solution

Examples

Example 1

Simple (using queens() method inside Main.java file)

  • Figures
    • Queens 8
  • ChessBoard 8x8
  • Results: 92
  • Elapsed time (ms): 840

Example 2

Complex (using complex() method inside Main.java file)

  • Figures
    • Black King
    • Black Queen
    • Black Rock
    • Black Knight
    • Black Bishop
    • White King
  • ChessBoard [9x6]
  • Results: 20136752
  • Elapsed time (ms): 30800

Machine: Intel Core i7, 2.0Ghz, 16GB RAM

About

The task is to count the number of pieces combinations when none of them capture another

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages