Tractor Befunge

By clp

This field is Turing-complete.

There's a tractor in a field, driven by a farmer.

You can write instructions for the farmer in the field.

When the tractor reaches an instruction, the farmer follows it.

The tractor has a trailer where it carries a stack of bales of hay.

The bales of hay represent numbers.

The farmer can do arithmetic with bales of hay.

When the tractor drives over a number, they put a bale of hay representing that number on the top of the trailer.

When the tractor drives over an arithmetic instruction, they take two bales of hay off the top of the stack, producing a new bale of hay, and put that back on the top.

When the tractor drives over an "if" instruction, they take a bale of hay off the top of the stack. If it's a zero, they go one way, otherwise they go in the opposite direction.

(This field is equivalent to the Befunge language)

'ow do?

You can move the tractor by clicking and dragging it with the left mouse button.

You can turn the tractor round by left-clicking it.

You can select a space by left-clicking it.

Type or click a button on the sidebar to write an instruction in the selected space.

The small arrow shows which way the selection will move after each typed instruction.

You can move the view by clicking and dragging with the right mouse button.

You can zoom in and out with the mousewheel.

You can control the tractor's speed with the slider above the instruction buttons.

Press Go to tell the farmer to drive.

Press Stop to tell the farmer to stop driving.