An open API service indexing awesome lists of open source software.

https://github.com/pythonlessons/quadigi_task


https://github.com/pythonlessons/quadigi_task

Last synced: 10 months ago
JSON representation

Awesome Lists containing this project

README

          

# QuaDigi_task Exercise

## Part 1
You were given a map (2 dimensional grid) where each cell is either forest (marked as X) or grassland (marked as O).
Write a script that gets number of isolated forests on the map. Forest is formed of cells X that are connected in one of 8 directions. In case code is not working, please explain the search strategy.
(Example on next page)

## Example:
There are two forests in the map (red and green) bellow:
0X0X0
00XX0
00000
0XX00

## Part 2
Add some tests (2-3) for the task above.
It would be preferable to use unittest library to create assertions for methods.
It would be nice if the tests are written in a separate file but not necessary.