Minsky Swap

From Esolang
Jump to navigation Jump to search

Minsky Swap is an esolang based on Minsky machines and created by User:PythonshellDebugwindow.


Programs in Minsky Swap have access to two unbounded registers; however, only one of these registers can have "focus" at a time. The current register is pointed to by a register pointer.

Syntax and Semantics

Minsky Swap code is split onto two lines. The first line is the actual code to be executed and is known as the code line, and the second line contains a list of numbers and is known as the jump line. The code line is split into characters, each character being a command; the commands are listed below.

Command Effect
+ Increment the register under the register pointer
~ If the register under the register pointer is nonzero, decrement it; otherwise, jump to command M, where M is the Nth number in the jump line and this ~ is the Nth tilde in the code line
* Swap the register pointer

Readable Minsky Swap Notation

Readable Minsky Swap Notation (RMSN) is a more readable notation for Minsky Swap. It is reminiscent of Portable Minsky Machine Notation. In RMSN, each command is on one line. inc(); increments the current register; decnz(N); decrements the current register if it's nonzero, and jumps to line N (1-based) otherwise; and swap(); swaps the register pointer.

Computational class

A normal Minsky Machine has access to both registers at the same time, but Minsky Swap doesn't, so TC-ness is presumed but unknown.