Human Resource Machine/Year 28

Strategy
This level can be particularly challenging, especially for non-programmers. You need to compare three numbers to each other to determine what order they should be placed in. The trick is not to find yourself subtracting all three numbers from each other. Instead, you can break this problem up into to major parts: For the first step, all we want to do is compare the first two numbers, and then place the smaller one in box 0, and the bigger one in box 1. That will set you up for the second step. Now you can tell where the third number ranks because you have the first two in the correct order. Either is will be smaller than the small number, or it will be between the two numbers, or it will be bigger than the big number. At that point, you can output the numbers in the order you have determined.
 * 1) Start with the first two numbers and decide which one is smaller.
 * 2) Take the third number and decide whether it is smaller than both, smaller than one, or bigger than both numbers.

For the comparison of the two numbers, this program will employ the step-saving technique of subtracting the number before copying it somewhere, and then restoring the number by adding the other number back in. (See the optimizing notes for for more explanation.)

a: b:   INBOX COPYTO  5 INBOX SUB     5 JUMPN   c    ADD      5 COPYTO  1 COPYFROM 5 COPYTO  0 JUMP    d c:    ADD      5 COPYTO  0 COPYFROM 5 COPYTO  1 d:   INBOX SUB     0 JUMPN   f    ADD      0 SUB     1 JUMPN   e    ADD      1 COPYTO  6 COPYFROM 0 OUTBOX COPYFROM 1 OUTBOX COPYFROM 6 OUTBOX JUMP    b e:    ADD      1 COPYTO  6 COPYFROM 0 OUTBOX COPYFROM 6 OUTBOX JUMP    g f:    ADD      0 OUTBOX COPYFROM 0 OUTBOX g:   COPYFROM 1 OUTBOX JUMP    a