The largest square: It's about finding the largest square possible on a board while avoiding obstacles.
- A board is transmitted to you in a file passed as an argument of the program.
- The first line of the board contains the information for reading the map:
- The number of lines on the board;
- The "empty" character;
- The "obstacle" character;
- The "full" character.
The board is made up of 'empty' character and 'obstacle' character lines. ◦ The purpose of the program is to replace the "empty" character "with" full "character to represent the largest possible square. ◦ If there are several solutions, we will choose to represent the topmost square at left
-Python 3
Clone the repo over SSH :
git clone git@github.com:djenadi/Exercice_Python_Algo.gitOr over HTTPS :
https://github.com/djenadi/Exercice_Python_Algo.gitTo run the script : $./find_square example_file
'examle_file' should contains a valid map file :
- All lines must be the same length.
- There is at least one row of at least one box.
- At the end of each line there is a new line.
- The characters present in the card must be only those presented on the first line.
- In the event of an invalid map, you will display the error output: map error followed by a return to the
- line then it will move on to processing the next tray.
- If you want to have some benchmarking, you can run the script with:
$./find_square -p example_file
- If you want to execute unittest, you should execute:
$python -m unittest test_boardhelper.py
Feel free to contribute, make sure that you .py file pass the flake8 linter.
DJENADI AMIR REDOUANE, amirredouane@ymail.com