This repo provides a backtracking implementation of the popular N-Queens problem with an added constraint: no 3 queens should form a straight line at any angle. The implementation relies on a basic chess framework that provides appropriate abstrations for solving chess problems. The framework could be easily extended to include other algorithms for the N-Queens problem or other chess problems.
./gradlew clean build -x test
./gradlew clean test
./gradlew run --console=plain
Follow the instructions displayed in the console.
The nqueens
package contains the implementation of the N-Queens problem with the constraints described in the project overview.
The project uses the MVC design pattern so it contains 3 main packages:
model
: basic abstraction of a chess boardview
: basic abstraction of a chess board user interface plus a text-based implementationcontroller
: a runner that takes input from the user and displays output in the view