Nikola Mis wrote:Function should be recursive , right?
Liutauras Vilda wrote:Why do you think so? I'm not saying Yes or No, I'm just asking you.
Campbell Ritchie wrote:I think you will have to provide more explanation than that.
Nikola Mis wrote:Ok i will try, in this given maze, first and only step is to go R(right),
on the second right you can go right and left, if you go left there is end because you cant go up nor down nor left, you can only go back right and that's same route so 2nd step needs to be R again.
Piet Souris wrote:Be careful with marking cells as being visited. You might miss a shorter route
Piet Souris wrote:For those fond of this kind of puzzles, a nice variant can be found on Project Euler, 81-83.
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your databasehttps://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database