*** SPOILER *****
This is how I did it , more then likely a messy way of doing it but it seemed to work
Tried to upload a screen grab but wouldn't let meQuote:
Repeat While Not wall ahead
Do Move Forward
+ If not wall to the right then
+ if not wall to the left then
OB1 did that ;)
Done it now, so much easier when you know all the commands available to you... *grumble*
Which is pretty much the same as Tom's, but with the evil of a nested if. sparkeh's looks neatest so far, I reckons.
And no I have not just been doing this all morning :p although I am clearly out of practice at my algorithms.
Heres how i did it:
--if not wall ahead
I didnt know you can change the wall ahead LOL
Attachment 14286Here's mine... little different but it works....
@DT2 Nice.. Little man goes straight there.
My issue was I could make a script so he got to the end but hypothetically if the map was reversed he would get caught in the loop. So would these answers still work if you were given a mystery map, especially if you think about the island problem with wall following. Or am I over thinking the problem as usual?
Mines a bit like DT2's, just using an extra else if in the original if.
Edit, okay its a LOT like DT2's lol
Annoyingly this doesn't seem to work in IE8, with or without the Smoothwall, so students can't use it as a ten minute muck about at the end of a lesson - anyone else had problems with that/found a way around it that doesn't involve me pushing a Chrome MSI out especially for this?
It's a shame there isn't a second "level" as someone pointed out - because some solutions work for certain classes of maze, and some are general. I don't believe any of the simple ones we have created here are fully general (is the left wall follower general for all mazes?) - it would be fun to find out :)
Worked in firefox here, we have a portable network install that the kids used to have a play.
If there's a way of getting it to work in IE8, lovely, if not, it may have to wait for IE9/Chrome in September.