Added some comments after reread the code - It's a long time i did not have a look to it !
At the definition of dirtable list, remove immediately the direction where we come from
to avoid searching in that direction (because it is always returning a CANT, of course).
This is the very first basic "optimisation" of the algo.
Intermediate non functionnal loop - But the Weighting algorithm looks to work in global case.
Need to add the boundaries test to avoid out of range access in rows/cols tables, and activate the real
return value in the choose_direction method
Boundaries check added to the countlines method.
Now it is working but choose_direction STILL returns only random value.