Möbius

From Esolang
Jump to navigation Jump to search

Möbius is an esoteric programming language which works on a Möbius strip.

Data Model

Möbius works on a resizable möbius ring of deques; initially, there is only a single deque. To access a side of the deques, one must go to that side on the möbius ring. There is a convenient command to do this. Along with the tape of deques, there is a 3-tuple of scalars to be used for variable storage and a stack that can be used for saving the data in this infinite array. I use that data model a lot.

All data storage mechanisms can hold an unbounded number of long integers.

Commands

Command Name Meaning Before After
! NOT Logical inversion (0→1, n→0) a... ...(!a)
" STRING Toggle string mode (start/stop injecting characters as their Unicode values (adds a null before starting)) N/A N/A
# LOTS Pop n, pop v, inject n vs ab... ...(b a times)
$ DROP Remove a value and discard it ab... b...
% TURN Go 360 degrees around the tape N/A N/A
& LOC inject the current location b... (loc)b... (output "a")
' INSERT Create a new empty deque to the right of the current location N/A N/A
( STARTBLOCK Begin a command block N/A N/A
) ENDBLOCK End a block of commands N/A N/A
* JUMP Pop a value and go that many deques around the tape ab... b...
+ INC Pop a value and inject its successor a... ...(a+1)
, INPUT Get a single character as input and enqueue its Unicode value ... ...(ord)
- DEC Pop a value and inject its predecessor a... ...(a-1)
. PRINT Pop a number and output its Unicode equivalent a... ...
/ ??? ??? ??? ???
/[0-9A-Fa-f]{1, 4}/ VAL Inject a value from a hex code ... ...a

Computational Class

The language is not Turing-complete in its current state because it has no flow control mechanism whatsoever. It is impossible for any command to be executed more than once. Thus, every program will halt. If there were a way to conditionally repeat a "block of commands," like, e.g. Brainfuck's [], it would likely be Turing-complete.