Skip to content

Armanx200/Magic-Square

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

🌟 Magic-Square Solver 🌟

Welcome to the Magic-Square Solver project! This project aims to solve magic squares of any order using Python. Whether you're a math enthusiast or just curious about magic squares, this program is designed to help you explore and understand these fascinating structures.

Features

✨ Solve magic squares of any order
✨ Input validation to ensure a valid magic square
✨ Interactive interface for ease of use
✨ Detailed output with step-by-step solutions
✨ Fun and educational for all ages

Getting Started

  1. Clone the repository:

    git clone https://github.com/username/Magic-Square.git
    
  2. Navigate to the project directory:

    cd Magic-Square
    
  3. Run the solver:

    python magic_square_solver.py
    
  4. Follow the prompts to enter your magic square dimensions and values.

How It Works

The solver uses a combination of algorithms to determine if a given square is magic and, if so, to find its solution. It checks the rows, columns, and diagonals to ensure they all add up to the magic constant, which is calculated based on the square's order.

Example

Let's say you have a 3x3 magic square:

8 1 6
3 5 7
4 9 2

The solver will verify that all rows, columns, and diagonals add up to 15 (the magic constant for a 3x3 square) and then provide the solution steps.

Contributions

Contributions are welcome! If you have ideas for improvements or new features, feel free to fork the repository and submit a pull request.

Credits

This project was inspired by the magic square concept and built with love by [Your Name].

🌈 Happy magic square solving! 🌈

Arman Kianian