Yellow Four Code

From Esolang
Jump to navigation Jump to search

Yellow Four Code is a language similar to Malbolge, based around being confusing and useless. The program is loaded into memory at the beginning.

Base Four

The number system is based around 8 Base4 bit memory cells. Each additionally is attached to an address.

  • 0 - Pointer - 8 bit
  • 1 - Instruction pointer - 8 bit (points to individual 4bits so memory is 213 traditional bytes in memory)
  • 2 - Input (when op2) / Output (when op1 exit on 33333333) - 8 bit. It holds the value of a register and the crazy operation still applies on getting and putting. Input overwrites the last 4 bits, though, with the ascii value.
  • 3 - Point to (relative to current location by addition)

Operation and Operands

The operands are formed by repeating 3's ended by 0, 1, 2. Once you have two operands, suchas 33332, 31, 2, 330, you then perform the crazy operation

     op2
    0 1 2 3
o 0 2 3 1 0
p 1 1 0 2 3
1 2 0 1 3 2
  3 3 2 0 1

between bits of the operands as shown

op1 0 1 2 3 4 5 6 7
op2 1 7 4 6 3 0 5 2

and the result is stored in op1.

Compiling

A compiler is yet to be implemented; if someone does it, it'd be cool. Whether it is Turing-complete is yet to be answered.