C++ programming _ recursion _ maze problem