From StrategyWiki, the video game walkthrough and strategy guide wiki
Jump to navigation Jump to search

Instructions[edit]

Storage Floor

Imagine each thing in the INBOX is an address. And each address refers to a tile 0-9 on the floor. Your task: For each address in the INBOX, pick up the letter at that address and OUTBOX it.

Congratulations! You can now access tiles on the floor INDIRECTLY! Observe this example to see how it works, compared to what you've been doing so far:

Strategy[edit]

Indirect access is a powerful tool. Instead of saying that you want to copy from (or to) a specific box, you can copy from (or to) the value contained in a particular box. For example, if box 9 contained the number 0, and you asked to copy from box 9 indirectly, what you're really asking is to copy from box 0. The worker will look at what value is contained in box 9, and then go to the box specified by that value.

Indirect access is indicated by a pair of brackets around the number. So while COPYFROM 9 means to copy the value in 9, COPYFROM [9] means to copy from the box that matches the value in 9. This exercise is designed to illustrate just that.

The floor has a set of letters in boxes 0 through 9. All you are asked to do is grab a number from the INBOX and then grab the letter from the box whose number matches the one you just picked up. In order to do that, you'll have to set it down in a box, and then indirectly access that same box to pick up the correct letter. This very short program will look as follows:

a:
   INBOX   
   COPYTO   12
   COPYFROM [12]
   OUTBOX  
   JUMP     a

Optimizing[edit]

It is not possible to further optimize this solution.