Stack Memory Tutorial 1

Puzzle Number 981

SOLVED!

Sort of stumbled on the answer, but I'll claim it's down to my genius.






http://www.robozzle.com/js/play.aspx?puzzle=981

Stack

So we use the stack...no surprise there. But how?

Well first instruction is bound to be FORWARD.
Second instruction is bound to be IF GREEN GO F1.

and somewhere later (position 4 or 5) there's bound to be an IF BLUE GO F1.

That really narrows down the options.

Have a try with those clues. 

I'll go have a cup of tea.





(scroll gap...for brew)








So Where Were We

This is the part filled solution:





How does it stack up?

When we hit a blue, the instructions after the blue get added to the stack.

When we hit a green, the instructions after the green (including those after the blue) get stacked.

And the instruction after the green will have to be an "ON RED". like this:





so that it wont run when we get to a blue square.

Can you tell what it is yet

Now obviously there aren't going to be any right turns; so you just need to try some combination of Lefts and Forwards.

That's about as far as I can go.

Scroll down if you still need the answer...






(stares out window for effect)







The Solution


Hopefully everyone managed to solve it from the clues above but if not...







6 comments:

  1. I have managed to solve puzzle 1736 (learning stack 3) with the helpof your clues. Bit I'm not quiet sure if I have grasped this all concept of stacks. Especialy using only F1. I will really appreciate any further explanation on stacks.
    Thank you 🙂

    ReplyDelete
  2. Replies
    1. Red? Green? Doesn't matter. First one not blue is the key!
      As in..if blue go F1 else FWD, Right.

      http://www.robozzle.com/beta/index.html?puzzle=532&program=Ogzccdabaaa

      Delete
  3. Replies
    1. I don't know.
      Checking the comments it says if you can do 354 you can do 352.
      I see that I've done 354 but I can't remember how!

      Delete
    2. Okay I figured out 354:
      Leave the red, turn then go to F2 to build some stack:
      http://www.robozzle.com/beta/index.html?puzzle=354&program=OfbHGbIHmdbaa

      Still can't do 352.

      Delete

Please post solutions, suggestions or frustrations.