Varnand
Varnand is an esoteric programming language created by User:DoggyDogWhirl. Its name is a combination of "var", an abbreviation of "variable", and "nand", as in the NAND operation.
The purpose of Varnand was to create a language where the only operation is the logical NAND. However, with only hexadecimal literals, it is impossible to create values above 15 (or below 240 if using an 8-bit NAND), making printing letters impossible, so there is also a rotation operation.
Commands
Varnand uses Polish notation. All commands return their value. Varnand does not have a way to loop, and thus is not Turing-complete.
Command | Description |
---|---|
! _ _ |
Logical NAND |
% _ _ |
Rotates first value left by second value of bits |
O _ |
Outputs value as a number |
P _ |
Prints character with given value |
I |
Inputs one character |
[0-9][A-F] |
Hexadecimal value 0-15 |
[a-z] |
All variables, initialized to 0 |
= _ _ |
Set variable (first argument) to value |
All other symbols are considered comments (although "U" is the only vowel available).
Example programs
2
Outputs "2".
O2
Cat program
One-time cat program:
PI
Hello, world!
Uses (A NAND A) NAND (B NAND B) as logical OR.
P!!%44%44!88 P!!%64%64!55 =lPP!!%64%64!CC =mP!!%64%64!FF P!!%24%24!CC P%24 P!!%74%74!77 Pm P!!%74%74!22 Pl P!!%64%64!44 P!!%24%24!11
Newlines are not necessary and do not affect code.
Adder
Adds the values of two inputted characters (mod 256), and outputs that value's character.
=xI=yI =o0 =n!00 =c0 =a!n!1x=b!n!1y =d!ab=e!!da!db =f!ce=g!!fc!fe=o!!oo!gg =h!df=c%h1 =a!n!2x=b!n!2y =d!ab=e!!da!db =f!ce=g!!fc!fe=o!!oo!gg =h!df=c%h1 =a!n!4x=b!n!4y =d!ab=e!!da!db =f!ce=g!!fc!fe=o!!oo!gg =h!df=c%h1 =a!n!8x=b!n!8y =d!ab=e!!da!db =f!ce=g!!fc!fe=o!!oo!gg =h!df=c%h1 =a!n!%14x=b!n!%14y =d!ab=e!!da!db =f!ce=g!!fc!fe=o!!oo!gg =h!df=c%h1 =a!n!%24x=b!n!%24y =d!ab=e!!da!db =f!ce=g!!fc!fe=o!!oo!gg =h!df=c%h1 =a!n!%44x=b!n!%44y =d!ab=e!!da!db =f!ce=g!!fc!fe=o!!oo!gg =h!df=c%h1 =a!n!%84x=b!n!%84y =d!ab=e!!da!db =f!ce=g!!fc!fe=o!!oo!gg =h!df=c%h1 Po