Well, I was trying to solve the following problem: Suppose I have a "map of a city." I have a source and a destination. There are streets that are blocked and streets that are free. Wanted to create an algorithm to tell me which path to take to get to the destination, passing through the streets that are free.
example:
S - Source
D - Destination
F - Free Streets
B - Busy Streets
B B B B B
S F F F B
F B B F F
F F B B D
B F F F F
In this case, would have two possible routes:
B B B B B
S - - - B
* B B - -
* * B B D
B * * * *
Was thinking of doing the following:
Make a function to check whether the directions were free. If for example the east
is free, the function would create a thread with the new coordinates, x and y + 1
and so on, would create a thread for each direction in each "point"
. I do not know if this is the best way, but was wondering if someone can give an idea of some other way to do!
Was thinking of doing in python, because I'm more familiar with the language. I'm just doing it as a hobby.