14
$\begingroup$

enter image description here The goal of this puzzle is to find a sequence of max 5 commands that will move the triangle through the maze and visit all colored squares.

Three types of commands can be used:

  • F0 makes the sequence start over.
  • The arrows (↑, ↱, ↰) move the triangle (forward) or make it change orientation (clockwise, anti-clockwise).
  • 🖌️s change the color of the square the triangle is in to the color of the 🖌️. Each command can (but does not need to) have a color. A colored command is only executed if the triangle is in a square of the same color.

If you want to play around with the mechanics interactively, you can do that here. (Disclaimer: I am one of the developers of the site.)

CLARIFICATIONS:

  • Attempting to move out of the board is not allowed.
  • The sequence terminates automatically once all squares have been visited.
  • Grey squares are not colored squares. They considered "out of the maze".
$\endgroup$
  • $\begingroup$ From playing around with the interactive version, it seems that grey is not a colour, and in fact moving to a grey square is considered "moving out of the board". Is that correct? $\endgroup$ – Jaap Scherphuis Dec 17 '19 at 14:47
  • $\begingroup$ "🖌️s change the color of the square the triangle is in to the color of the 🖌️. Each command can (but does not need to) have a color. A colored command is only executed if the triangle is in a square of the same color." That means 🖌️ is a no-op. $\endgroup$ – msh210 Dec 17 '19 at 14:52
  • $\begingroup$ @msh210 I think there are two separate colours associated with a 🖌️ command. (1) Any command can be coloured, meaning that it is only executed when the colour of the current square matches. (2) The 🖌️ command, specifically, has a parameter which is a colour but needn't be the same as the colour of the command, saying what colour to paint the square with. Think of #1 as the colour of a box the command is in (the box is only opened when the colour matches where you are) and #2 as a part of the command itself. $\endgroup$ – Gareth McCaughan Dec 17 '19 at 15:46
  • $\begingroup$ FWIW I am red-green colour blind (pretty common) and find the magenta(?) and blue(?) very hard to distinguish. $\endgroup$ – Jonathan Allan Dec 17 '19 at 16:58
  • 1
    $\begingroup$ @JonathanAllan Sorry about that. I didn't think about it. I will write it down and fix it as soon as I have the time. Thank you for pointing it out. $\endgroup$ – Lucas Dec 17 '19 at 17:20
9
$\begingroup$

I've solved it! Enter my commands on the interactive puzzle to see it play through, or watch this heavily compressed .gif I made.

enter image description here

Some commentary on how I worked through it (probably not that insightful):

I spent maybe an hour running into walls and messing with the painting commands. So I decided I would at least try to make him do a simple circle, so I went with up, left, up. Then my next thought was just to escape out of that sequence, so I tried turning purple right, and boom, it worked.

And some suggestions for improving the app:

I think the most helpful things you could add here is a "step" button, that allows you to run the program step by step, and a pause/play button that allows you to pause execution. I also found it surprising that when I first ran my solution, upon completion, I was immediately taken to the homepage. I was really stressed for a moment as I went back to remember my answer.

$\endgroup$
  • $\begingroup$ Well done! I see what you mean. "Debugging" solutions should be easier. Sorry about redirecting you to the homepage. I just put the minimal necessary things together to make the puzzle playable without solving the ones that precede it. Thank you for the feedback! $\endgroup$ – Lucas Dec 17 '19 at 23:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.