Hmm, as I have mentioned to other people (not that I expect you to have read that) you may need to use a visited array to log where you have already travelled and check that where you move next is not somewhere you’ve already been.
Once you’ve done that you won’t go around in circles any more. It might still not work, if so you can change the direction you rotate the Vector and you’ll probably find your way to the treasure eventually. You could do very clever things to find the closest route to the treasure, but it would take you (and me) a very long time to work out.
Whether it’s your code from fragile maze or not, it does seem quite likely that it’s taken from the internet.
Anyway, if it’s really not, or you don’t want to accept it, you still need to pass the level. I think it could be yours considering you’ve chosen not to look at the solution for this level as well.
I think you should at least try my advice and see if you can work it out.
Danny