Minsky Register Machine Simulator

How To Use This Machine

This machine has two parts: an array of integers (the memory) and a list of instructions (the code)

This machine only has two instructions: inc and branch. They take the following arguments:

inc <memory index> will increment the integer at that memory cell

branch <memory index> <codepoint a> <codepoint b> will first check if the integer at <memory index> is greater than zero. If it is, it decrements that integer and jumps to <codepoint a>. Otherwise, it jumps to <codepoint b> without decrementing the memory cell's value.

Examples (the first line goes in the data input box, the rest goes in the line numbered code box: TODO handle nils correctly

0 0 1 0  
 
inc 0 

result: #(1 0 1 0)

0 0 0 1 0  
 
inc 0  
inc 1  
branch 0 4 5  
inc 0  
inc 0  
inc 0 

result: #(2 1 0 1 0)



Output:
#(1 0 0 0)