BackStart

From Esolang
Jump to navigation Jump to search

BackStart is a version of the Minsky machine with a single counter.

Commands

Command Operation
i x Add x to the counter.
d x Decrement the counter x times if it is not zero; if it is zero return to the start of the program. If the counter is lower than zero following the decrementing, an error is signaled.
b Return to the start of the program.
o x Output the number x if does not equal zero. If x is zero, output the counter instead.

translation to UBLANG

BackStart UBLANG
i x + x times
d x - x times
b /
o 0 .
o x * x times, ; and / x times

Examples

Hello World

The following program prints “Hello, world!”:

o 72
o 101
o 108
o 108
o 111
o 44
o 32
o 119
o 111
o 114
o 108
o 100
o 33

Infinite Counter

This program prints the infinite sequence of integers starting from inclusive one (1):

i 1
o 0
b

Interpreter

  • Common Lisp implementation of the BackStart programming language.