The year is 2090. Kaizen Security has commissioned an Australian successor to the Woodpecker processor.

The engineers decided that four instructions were two too many. So they halved the instruction set.

And the name.

Unfortunately, it still needs to do multiplication. That's your problem.

The machine

Ocker has an infinite tape of bits, a head pointing to one cell, and a one-bit register called store.

Ocker architecture A tape indexed by integers. In this example the head is at cell 0, containing 1, and its store register contains 0. The tape continues in both directions. -3-2-10123 …0001010… 0 TapeHeadStore

Its two instructions, F (Flip) and M (Move), are composed of the original Woodpecker instructions as follows:

OckerWoodpeckerEffect
FLOAD INVCopy the current bit into store, then flip that bit on the tape.
MINC CDEC CDECMove the head one cell right if store is 0, or one cell left if it is 1.

The tape extends infinitely in both directions, with integer cell indices. Initially, the head is at cell 0, store is 0, and all cells are 0 except for the inputs.

The challenge

Write the shortest possible Ocker program to perform the following operations. Integers are unsigned and stored least significant bit (LSB) first, with the LSB at the lowest address. Only the final output cells are checked; everything else may be changed. AI assistance is encouraged.

LevelOperationABOutputTarget
01-bit addition012–316
116-bit addition0–1516–3132–48100,000
216-bit multiplication0–1516–3132–6310,000,000

The score is the number of instructions executed. Try to meet or beat the target for each level.

Verifier

Paste a program using F and M, optionally followed by a positive repeat count. For example, FM3F2 means FMMMFF and still counts as six instructions. Whitespace is allowed between tokens and before counts.

Your program stays in your browser. Tests are fixed and public; passing them is not a proof of correctness for every input. The verifier accepts expanded lengths up to 253 − 1.