Puzzle Number 244
SOLVED!
Saw some people struggling with this so had a go and actually managed to solve it!http://robozzle.com/js/play.aspx?puzzle=244
Solution is down below but follow the clues and you will be able to solve it....I
Stack
Ok, looking at the puzzle we can see we're going to have to use the stack. That first column misdirects but you can see that in the second column we are going to have to left turn to face the red then step forward, adding to the stack each time on a blue.Now, on a normal stack puzzle we would simply be adding one forward step each time so after turning we would be taken back to the starting square, but here we have the stars at the bottom so we have to go down to get them...but luckily they are that same number of steps again!
Can you see now how we can get both stars in a column?
(scroll gap...for effect)
So we need to add 2 forwards to the stack each step.
Can you solve it now?
(scroll gap)
But we need to get back to the middle
Yes, we need to get back up to the middle to turn right and cross to the next column."But how are we going to do that? We're stuck all the way down at the bottom with nothing left in the stack!"
Well here's the trick: we're going to use F3 for a new stack...
and go all the way up to the red at the top...
and then half way back down again
There are an EVEN number of steps from bottom to top
Can you solve it now?
There should be enough clues there to solve it if you know how to use the stack but if you really need to see the solution scroll down...
(gap for effect...could possibly put an ad in here or something)
The Solution
F2: Two fwds added to stack each forward step.F3: One fwd step added to stack for every two forward steps.
Can you do better?
That's 20 instructions. The website shows some people managed to do it in 18!If you know how or have any ideas please comment below.
jnpollack can!
jnpollack commented below with an 18 solution containing a concept I had never considered...using repeating steps in one function by blanking out others using colours.
I didn't explain that well but you can read his comment and I'll post the solution here.
In F1, condition all commands on blue, except for 2 of the turns.
ReplyDeleteThen in F2 and F3, replace the 2 red turns with a red F1.
That is amazing!
DeleteI never thought of that.
Thank you so much for posting.
I'm going to add your solution to the post.
You're welcome. Thanks for doing this blog site.
ReplyDeletePuzzles 37 and 656 (and with many others) can also be optimized using this method.
As a side note, I design and submit puzzles pretty regularly. Do you mind if I submit a puzzle that mentions your username and promotes this blog?
That's great, I'll check out 37 and 656.
Delete...and yes, please promote the blog.
btw do you know how to solve 3731?
Yes, I do; but let me suggest something first:
ReplyDeletehttps://code.google.com/archive/p/robozzlesolver/
Click on Downloads, then grab version 0.2
To use the solver, all you have to do is draw the puzzle, put the stars (dots) in, place and orient the bot, and enter the number of commands per function. Then to start the solver, click the 'Brute force!' button. You can also try the 'Evolution!' button, but I've never had great results with it.
Remember, this is a brute force solver. It literally attempts every possible solution until it finds a solution, or until all possible solutions have been attempted and have failed. This means that for puzzles that can be solved in 4 commands, it will produce a solution almost instantaneously. 5 commands takes about a second. 6 commands takes about 15 - 20 seconds. 7 commands takes about 3 minutes. 8 commands takes about 1 hour. 9 commands takes about 20 hours. These figures are for puzzles that use all 3 colors, and for only 1 function. 2-color puzzles will take less time. Multi-function puzzles will take more time. Also, times depend primarily on your CPU power. Unless you have the latest AMD Ryzen Threadripper or access to a supercomputer, solutions that are 11 commands or more may take months or even years to be calculated. [On a personal note, I just purchased a new computer to replace my 5-year old Dell laptop. This new computer has a Ryzen 7 3800X processor, which is about 8x faster than what I have now... and I'm having it overclocked! I'm excited to see how fast the RoboZZle solver will be on my new machine!]
Anyway, the reason I mention the solver is because puzzles like 3731 are better "explained" by a solver. In this particular case, the puzzle has only 2 colors, and begins with 3 forward commands; If you try to solve 3731 in 7 commands, it will fail, going through all possible solutions in about 1 minute. When you solve it in 8 commands, you will have the solution in about 1 second!
Sure, I could explain it by typing/talking about it; but I prefer to reserve discussions about methods/techniques for more complex/complicated puzzles. Anyway, check out the solver (if you're not someone who feels that using a solver is "cheating"), and let me know what you think!
Awesome! I didn't know about the solver. It solved 3731 in a fraction of a second and yes the solution is simple...I should have been able to see it but somehow didn't. Mind expanding stuff.
ReplyDeleteIt was the green squares in 3731 that threw me off...made me think there had to be left on green. Doh!
Delete