Skip to content

LuisBrime/eightqueenspython

Repository files navigation

eight_queens_python :shipit:

Build Status

This is the solution for Eight Queens Puzzle written in Python.

Tests

Found in test_basic.py

Tests were written with pytest and contiuosly tested each commit by TravisCI.

Solutions for the queens puzzle with N = 8 queens to N = 17 can be tested. By default the only test is for 8 Queens but the others can be uncommented.

Run the code

Prerequisites

Step by step

  1. Clone this repository

  2. Start containers Run the following command:

sudo docker-compose up -d --build
  1. Run containers Run the following command:
sudo docker-compose run web python main.py db postgres_queens

Running the code will solve for 8 Queens, it prints the number of solutions and each of them and stores them in a PostgreSQL Database.

To connect to the database and check for the solutions, run the following code:

sudo docker exec -it postgres_queens psql -U brime -d queensdb

This will enable you to type queries to the table solutions, for example:

SELECT * FROM solutions;

About

Cuenca's python coding challenge

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published