# 16b64

###### The world's silliest programming language.

**16b64** is a work-in-progress esoteric joke programming language
designed to question the fundamentality of constants in programming.

There are ten 16-bit constants in 16b64 that must be manipulated to generate the other numbers. They are numbered 0-9 and are based on the first 20 bytes of the SHA-256 hash of "16b64".

Operations are done to a stack with 16 bit words in reverse polish notation. The language has 64 instructions, each written with single characters. The operations include the characters A-Z, a-z and loops are done with (), giving 64 possible instructions.

The name comes from two parts: "16b" from the 16-bit stack and variables, and "64" from the 64 possible instructions that can be used.

##### The Birth Of The Idea

The idea for 16b64 came while I was looking over other esolangs, specifically Brainf**k (which I will shorten to "bf"). Something about bf intrigued me, the pure simplicity of the rules leading to intensely complex and creative solutions to work around the language, however, something seemed just too "easy" about it, and helpfully convenient. The idea of the + and - operators, being able to simply increment by one just didn't sit right with me as being inconvenient enough like the rest of the language. If you want the number 200, you can just type 200 "+"! Nonsense.

That gave the inspiration to make a language with the goal of being terribly inconvenient. Perhaps not the most inconvenient to exist, but certainly difficult to use.

Here is a quick example for the general concepts of 16b64.

Code | Explanation |
---|---|

5 | Puts 0x4fda (the value of the constant 5) on the stack. |

2 | Puts 0xfc26 (the value of the constant 2) on the stack. |

N | Bitwise NOT previous item on stack. |

a | Add together previous two items on stack (ignore overflow). |

X | Bitwise XOR previous two items on stack. |

5N | Puts 0xb025 (bitwise NOT of 0x4fda) on the stack. |

22a | Puts 0xf84c (0xfc26 + 0xfc26) on the stack. |

5N22aX | Puts 0x4869 (0xb025 XOR 0xf84c) on the stack. |

C | Print previous two bytes on stack to stdout in two 8-bit characters. |

5N22aXC | Prints "Hi" ("H" = 0x48, "i" = 0x69) |

## Online Interpreter

The online interpreter is a version of the Rust 16b64 interpreter compiled for WebAssembly. This online version is definitely a work in progress still; it uses a modified version of the interpreter which I intend to merge with the original. If it doesn't respond to your input then it has probably encountered an error of some sort.

Debug Messages

### Examples

###### Hello, World!

Prints "Hello, World!"

5r61lAaC3l33RAC7N92XlaC081lXlXC585raNXC042lANaC015AaC

###### Hello, World! x10

Prints "Hello, World!" 10 times, using loops.

613LA3bd(5r61lAaC3l33RAC7N92XlaC081lXlXC585raNXC042lANaC015AaC54Oa)

###### Doomsday Method Calculator

Calculates the anchor day for a given year for use in the doomsday method of determining the day of the week.

JJJJ099lalaaz099lalaaz099lalaaz099lalaazSlDllaa0pSlDllaaSb(6r92aAa)rb(6r92aAa)77r7NOaMN77rAaS1r5NAM00Xed(d092aAa9)52ONed(d00Xa9)092aAed(d58ONa9)102laXed(d102laXa9)d77r7NOaM00Xed(231lXaC26NArCi)52ONed(69r4raXC26NArCi)092aAed(763AraC663NalXC)102laXed(105laNXC3l67OAC663NalXC)1r5NAed(168AlXC608XrXC51r1lXaC)58ONed(792ONaC629lAaC)621rAAed(932laXC13N6NaXC393rarAC)9r55RXC701lOXC16NAlC106AAaU1l06AXC

###### Day of Week Calculator

Calculates the day of the week given a date in MM-DD-YYYY format. Built
off previous doomsday method calculator. WORK IN PROGRESS.

45O3bd(J099lalaa25Oleid)dS45Oed(S00Xi)lDllaa6Nf3bd(J099lalaa25Oleid)dS45Oed(S00Xi)lDllaa6NfdJJJJ099lalaa1Np099lalaa1Np099lalaa1Np099lalaa1NpSlDllaa0pSlDllaaSDN7r7ArMDrAS00Xed(0fD7r7ArM00Xeidd0f(S00XAi)0f3bdi)S5lpb(6r92aAa)rb(6r92aAa)77r7NOaMN77rAaS1r5NAM00Xed(d092aAa9)52ONed(d00Xa9)092aAed(d58ONa9)102laXed(d102laXa9)d77r7NOaM0p2rN3aaS6r14XAcd(bi(N52ONaai))6r14XAed(d6rN0lOai)58ONed(d9l24Aaai)1r1Arred(d58Olai)2r3Xrred(d25Ollai)7r1Arred(d0l5Ollai)14X0Aed(d0fb0p(1r1ANai)0fbid(6rN0lOai))52ONed(d0fb0p(0l5Olai)0fbid(25Olai))a77r7NOaM00Xed(231lXaC26NArCi)52ONed(69r4raXC26NArCi)092aAed(763AraC663NalXC)102laXed(105laNXC3l67OAC663NalXC)1r5NAed(168AlXC608XrXC51r1lXaC)58ONed(792ONaC629lAaC)621rAAed(932laXC13N6NaXC393rarAC)9r55RXC701lOXC16NAlC106AAaU1l06AXC

## Reference

##### Constants

Instruction | Value (hex) |
---|---|

0 | 0x1c72 |

1 | 0x14bc |

2 | 0xfc26 |

3 | 0x7e37 |

4 | 0xb53f |

5 | 0x4fda |

6 | 0x20fe |

7 | 0x445a |

8 | 0xb76a |

9 | 0x25e5 |

##### Instructions

Unmarked instructions are currently unused.

The "Mode" category describes how the instructions interact with the stack. A table of modes is provided below this table. The "Stack" column describes how the total size of the stack will change after each operation.

Instruction | Mode | Action |
---|---|---|

A | Arithmetic | x AND y |

B | ||

C | Write | push x to STDOUT as two ASCII char |

D | Duplicate | duplicate x |

E | - | halt; exit program |

F | Complex Move | find value x positions down in the stack and move it to the top. (0 = top, 1 = second from top, etc) |

G | ||

H | Read | push next stdin to two values |

I | Read | push next two STDIN to one stack value |

J | Read | push next one STDIN byte to stack |

K | ||

L | Modify | x cyclic shift left by y places |

M | Arithmetic | y modulo x |

N | Modify | NOT x |

O | Arithmetic | x OR y |

P | Complex Move | move y to x positions down in the stack. |

Q | Constant | push random number to stack |

R | Modify | x cyclic shift right by y places |

S | Move | swaps x, y on stack |

T | ||

U | Write | push U+x to STDOUT as Unicode |

V | Write | push U+yx to STDOUT as Unicode |

W | ||

X | Arithmetic | x XOR y |

Y | ||

Z | ||

a | Arithmetic | x + y, set flag true if overflow |

b | - | flag = LSB of x |

c | - | x < y, set flag to result |

d | Delete | delete x |

e | - | x == y, set flag to result |

f | Complex Move | find value x%16 positions down in the stack and move it to the top (4 bit version of F) |

g | - | x > y, set flag to result |

h | ||

i | - | invert flag |

j | ||

k | ||

l | Modify | x cyclic shift left by 1 |

m | ||

n | ||

o | ||

p | Complex Move | move y to x%16 positions down in the stack. (4 bit version of P) |

q | - | randomly set flag to true or false |

r | Modify | x cyclic shift right by 1 |

s | ||

t | ||

u | ||

v | ||

w | ||

x | ||

y | Move | Pull bottom of stack to top of stack |

z | Move | Push x to bottom of stack |

( | - | start of loop, enter only if flag == TRUE |

) | - | loop if flag == TRUE |

Modes | |
---|---|

Arithmetic | Removes two values from the stack and adds one back. |

Read | Removes one or two values from the stack. |

Write | Adds one or two values to the stack. |

Move | Moves values around without changing amount of elements. |

Modify | Removes one value from stack, performs some operation on it, and places it back. |

Complex Move | Removes the top variable on the stack and moves the rest of the variables around. |

Duplicate | Removes one value from stack and adds two. |

Delete | Removes one value from stack. |

Constant | Adds one value to stack. |