Home

Awesome

cubix

A 2D esoteric language wrapped around the faces of a cube. Online interpreter, Code design helper

Basics

The first thing the interpreter does is remove whitespace, then figure out the smallest cube that the code will fit onto. The code is then padded with no-ops until all six sides are filled. That means that this "Hello, World!" program:

./v.o;@?/"!dlroW"S',u/"Hello"

is exactly the same as this one:

      . / v
      . o ;
      @ ? /
" ! d l r o W " S ' , u
/ " H e l l o " . . . .
. . . . . . . . . . . .
      . . .
      . . .
      . . .

Then the code is run like a 2-dimensional language, except that the IP (instruction pointer) wraps around as if the code were on a cube.

Commands

Unless specified otherwise (with "pop" or "in place"), operators do not remove their operands from the stack.

I/O

Arithmetic

Stack manipulation

Literals

Control flow

Example programs

All of these programs and more can be found in the interpreter itself.

Hello, World!

./v.o;@?/"!dlroW"S',u/"Hello"

Obviously no input is needed. Net form:

      . / v
      . o ;
      @ ? /
" ! d l r o W " S ' , u
/ " H e l l o " . . . .
. . . . . . . . . . . .
      . . .
      . . .
      . . .

Primality test

%@\?I:u;>O/)((./0\)?/

Input is the number to test. Net form:

    % @
    \ ?
I : u ; > O / )
( ( . / 0 \ ) ?
    / .
    . .

cat

@_i?o

Input the string to be output. Net form:

  @
_ i ? o
  .

Truth machine

!I\@O

Input 0 or 1. Net form:

  !
I \ @ O
  .