X strike

From Esolang
Jump to navigation Jump to search

X strike is an esolang created by User:Infinitehexagon. It has 4 commands and a keyword used for separating arguments.

Commands

Command Description
X!×a Increment the cell under the memory pointer by a then shift the memory pointer right.
x!×a Decrement the cell under the memory pointer by a then shift the memory pointer left.
a×b Goto line a if the cell under the memory pointer equals b. Lines are enumerated commencing with the number one (1).
x^a×b×c Store decimal input into cell a and output cell b if cell c is nonzero. If any of the arguments are below 0, they get skipped.

Programs / Example Programs

Hello world

X!×72
x^-1×0×-1
X!×101
x^-1×1×-1
X!×108
x^-1×2×-1
X!×108
x^-1×3×-1
X!×111
x^-1×4×-1
X!×32
x^-1×5×-1
X!×119
x^-1×6×-1
X!×111
x^-1×7×-1
X!×114
x^-1×8×-1
X!×108
x^-1×9×-1
X!×100
x^-1×10×-1

One Time Cat

x^0×0×-1

Repeating Cat Program

This cat program perpetually queries for a number and outputs the same:

x^1×1×-1
X×1×0

XKCD Random Number

X!×4
x^-1×0×0

Truth Machine

x^0×-1×-1
x^-1×0×-1
X×2×1

Modulo program(n mod 256)

x^0×-1×-1
X!×0
x^1×-1×-1
X×7×-1
X!×1
x!×0
X×5×256
x^-1×1×-1

Computational class

Language is Turing-complete. It can be proven by translating brainfuck with GOTO commmands into it. Note that it assunes that argument for X!×a and x!×a could be zero, even though it is probably Turing-complete even with restriction that they could only be positive. Initialize tape:

X!×0

+ command is translated like that:

X!×1
x!×0

- command is translated like that:

x!×1
X!×0

> is:

X!×0

< is:

x!×0

Jump to line a if cell is zero:

X×a×0

Interpreter

  • Common Lisp implementation of the X strike programming language. Please note that the concrete character set deployed constitutes a dependency on the Common Lisp implementation; in corollary, Unicode support may or may not be a feature incorporated in the personal environment. The interpreter at hand has been developed and tested with Steel Bank Common Lisp (SBCL) version 1.1.4 as part of the Lisp Cabinet 0.3.5 bundle.