Programmer's Shop: Commands

Your job is not to be fast with your hands. Your job is to write something the machine can be fast with, without a single spare block.

How a workshop works

1. The belt feeds blanks left to right: colour, shape, sometimes an empty slot. The arm sits over three positions and grabs exactly what is under it.

2. Commands: grab, place, advance belt, return a part, repeat (until empty), if (colour or position). Nesting of repeat and if goes two levels deep, otherwise the program stops being a program.

3. On top there is an order: the exact part sequence in the bin. The order is checked against what actually happened, not against your intentions — one swap and the cycle is broken.

4. Two metrics: program length (block count) and cycle time (arm steps). The order is accepted only when both fit the workshop budget.

5. The same program may stall on a different feed: in free mode your program runs against three belts at once.

Tips

  • Walk the order on paper first and count the steps: a program written without counting is thirty blocks instead of twelve.
  • A condition beats a branch: repeat-until-empty is usually shorter than four identical blocks.
  • Watch the last block: if it does not return the arm to its start, the cycle closes wrong.

We use cook​ies for analytics. Click "OK" to consent.

Details