hi Dan,
you start with 'isPath(mat, 0, 0, 0, 0)'. (see line 20).
Now, look at line 26 (ish; the line numbers are getting
out of sync on my monitor here).
You
test:
if mat(0,0) + 1 != mat(0,0) then return false.
I must say: I do not understand the structure of your code: two public classes?
Anyway: my advice is: if you test your code, then put a boolean 'forward' as
a parameter in your 'isPath'. And depending on whether you go deeper or are going back,
set that parameter accordingly. Then, print out, as one of the first things of the isPath
routine, what the value is of x, y and this forward.
Start with a 2x2 matrix, and follow what is happening.
Greetz,
Piet