This project is a Django-based web application that provides solutions to the N-Queens, Polysphere pyramid, and Polyhex tetrahedron puzzles. Users can solve the classic N-Queens problem by specifying the board size or explore possible solutions for the Polysphere and Polyhex puzzles using a user-friendly interface.
- N-Queens Solver: An interactive solver that supports various board sizes (e.g., 4x4, 8x8).
- Polysphere Solver: Displays all possible solutions for arranging pieces on a puzzle board.
- Polysphere Pyramid Solver: Displays all possible solutions for arranging pieces on a pyramid-shaped board.
- Polyhex Tetrahedron Solver: Display all possible solutions for arranging pieces on a tetrahedron-shaped board.
- User-Friendly Interface: Visual, intuitive, and easy to use.
- Puzzle Modes: Options to solve puzzles yourself or view pre-generated solutions.
- Backend: Django, Python
- Frontend: HTML, CSS, Bootstrap for styling
- Optional Containerization: Docker, Docker Compose
ase_project/: Core Django application code.nqueens/: Logic and views for the N-Queens puzzle.polysphere/: Logic and views for the Polysphere puzzle.pyramid/: Logic and views for the 3D Polysphere Pyramid puzzle.polyhex/: Logic and views for the Polyhex Tetrahedron puzzle.static/: Static files including CSS, JavaScript, and images.templates/: HTML templates for rendering views.Dockerfile: Instructions for building a Docker image of the project.docker-compose.yml: Configuration for Docker Compose, setting up the application with a database.manage.py: Django's management script for running commands.
The project's dependencies are specified in requirements.txt. To install them, run:
pip3 install -r requirements.txt
- Python (version 3.6 or higher)
- Git (optional, for cloning the repository)
- Docker (optional, if you want to run the app with Docker)
To clone the repository, open your terminal or command prompt and run:
git clone https://github.com/Ilan-Goren/ASEProject.git
Alternatively, you can download the project as a ZIP file from GitHub and extract it.
In the terminal, navigate to the project directory:
cd ASEProject
-
Open Command Prompt and navigate to the project directory:
cd ASEProject -
Start the Django development server:
python3 manage.py runserver
-
Open Terminal and navigate to the project directory:
cd ASEProject -
Start the Django development server:
python3 manage.py runserver
Once the server is running, open a web browser and go to http://127.0.0.1:8000/ to access the application.
If you prefer to use Docker, follow these steps:
-
Build and Run the Docker Container
docker-compose up --build -
Access the Application Open your browser and go to
http://localhost:8000/. -
Shut Down the Docker Environment
docker-compose down
- Input the desired number of queens.
- Click "Go to solution" to view a pre-calculated solution for the board.
- Click "Solve it Yourself" to try solving the puzzle on your own.
- Place a queen on the board by clicking on a cell. Click an already placed queen to remove it.
- Use "Check Your Solution" to validate your placement or "Get a possible solution" for hints.
- Access the Polysphere solver from the application menu.
- Click "Start" to generate all possible solutions for a 5x11 board.
- View all generated solutions by clicking "Go see them."
- Use the filter to view specific solutions by providing a range.
- You can attempt to solve the puzzle yourself or use the auto-solve function to complete the board.
- Access the Polysphere solver from the application menu.
- Click “Start” to generate all possible solutions for a pyramid-shaped board.
- View all generated solutions by clicking "Go see them."
- Use the controls on the left to view specific solutions by providing a radius of sight and page size.
- You can attempt to solve the puzzle yourself or use the auto-solve function to complete the board.
- Access the Polyhex tetrahedron solver from the application menu.
- Click “Start” to generate all possible solutions for a tetrahedron-shaped board.
- View all generated solutions by clicking “Go see them.”
- Use the controls on the left to view specific solutions by providing a radius of sight and page size.
- You can attempt to solve the puzzle yourself or use the auto-solve function to complete the board.
If you plan to deploy the application in a production environment, set up environment variables such as SECRET_KEY for Django. Create a .env file if necessary, with content similar to:
export SECRET_KEY="your_secret_key"
export DEBUG=True
To configure the database or other services, edit docker-compose.yml. By default, the configuration uses PostgreSQL as the database service.
To contribute:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Submit a pull request for review.
For any questions or suggestions, please reach out via GitHub.