An implementation of a minimal counter machine.
This machine has two instructions:
INC a, which increments counter number a. Written as +2.JZDEC a i, which decrements counter number a if it's nonzero, and jumps to instruction i otherwise. Written as -2?5.Note that counters are numbered from 0, while instructions start at 1.
Source code on GitHub.
Input:
Output: