Human Resource Machine/Year 29

Strategy
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
It is not possible to further optimize this solution.