From Esolang
Jump to navigation Jump to search

Capuirequiem is an esoteric programming language by User:Zzo38 from the year 2006. All of the ASCII characters mapping to the code range 33 to 126 constitute valid content. The digits 0 to 9 as commands push their own value onto the stack. Lowercase letters and the apostrophe are valid characters to use as a part of a name. The language is stack-based and discriminates between three types: array, string, and integer.

There exists no command for comments, but this lacuna can be circumvented by defining a string of temporary duration only: Enclosing the commentary text with [ and ] and appending a Z command to immediately discard this string, the programmatically ineffectual object acts as a note to the reader without influencing the code. For example:

 [This is a comment.]Z

Capuirequiem is known to be Turing-complete because Underload without output can be compiled into it; albeit there are some pathological Underload programs which produce different output after being compiled.

List of commands

Character Function
[0-9] Number to stack
[a-z'] Append character to end of current name
[] Square brackets indicate a string, push to stack
A Make new array
B Integer division
C Concatenate strings
D Duplicate top entry of stack
E Multiplies exp(a) by (b) round down
F Logarithm log(a,b) rounded down
G Sets pointer position of array, or modulo of 2 numbers
H Calculates a to power of b
I Input one byte
J Position of program pointer inside of current block
K Absolute value of difference
L Loop if not zero, or replaces current block with a different string
M Calculates which of 2 numbers is larger
N Number negative one
O Output one byte, or output a string, or use external add-in function of a array
P Get position of pointer in array, or add brackets around a string
Q Cancels the current block
R Reverse the stack
S Swap top 2 values of the stack
T Figures out type of value at top of stack, 0=number, 1=string, 2=array
U Cancel block if zero
V Execute sub-routine in array using its own memory, or executes a string inline
W Converts number 0-255 to string of a single character, or adds backtrack point to global stack, or retrieves backtrack point, or can just discard a number -1 (which is a dead backtrack point)
X Executes a string as a separate block, or multiply 2 numbers together
Y Discard second from top entry of stack
Z Discard top entry from stack
( Number 100
) Number 256
" Removes current name
{ Store value in a variable with given current name
} Retrieve value from variable with given current name
@ Skip a number of commands
_ Negative value of number
, Get value from array, or multiply a number by ten and add the other number
. Store value in array, or subtraction of 2 numbers
- Decrement
+ Increment
< Move array pointer 1 space backwards
> Move array pointer 1 space forwards
| Separate number to half of it and the remainder, or split string at first character
= 1 if equal, 0 if not-equal
; Recombines numbers that were separated to half and remainder
/ Move data to global stack
\ Move data to normal stack
& Bit AND of 2 numbers
? Bit XOR of 2 numbers
* Bit OR of 2 numbers
# Add current name to stack
$ Pop a,b,s,v, push (s-v)*(a%b)
% Search stack for a value according to index into stack, or search a array for a value
^ Removes a number of values from the stack
: Count number of entries in the stack
! Number 10


Beer program:

[99 bottles of beer program]Z

"b[ bottles of beer]{
"w[ on the wall]!WC{

 [Take one down, pass it around,]O!O
[No more]O"b}O"w}O

Hello World program:

[Hello World!]O

Cat program (forever):


Cat program (stop at NULL):


Reverse input (stop as NULL):


ROT13 program (forever):

[Initialze array of values 0 to 255]Z

[Add 13 to value at position 65 to 77 in the array]Z

[Subtract 13 from value at position 78 to 90 in the array]Z

[Add 13 to value at position 97 to 109 in the array]Z

[Subtract 13 from value at position 110 to 122 in the array]Z

[Get values from input and transform according to ROT13]Z

Quine program:


Kimian quine program:


Fibonacci program:

[This function output a number in decimal format]Z
 D /01!\$ 48,_KW\C/

[Print out the fibonacci sequence]Z
[1.]O 0"a{1"b{ [
 "n}X [.]O


[These are the examples of backtracking-INTERCAL,
and they have been converted to Capuirequiem.]Z






Input a Capuirequiem program ending in NULL and execute:


Brainfuck interpreter:

[ Brainfuck interpreter in Capuirequiem ]Z

[Initialize variables]Z
 A+- "tape{
 [] "prog{

[Load program]Z

  [Begin loop]Z
  [D91,=U }91,W[},U]CC{ ]X

  [End loop]Z
  [D93,=U }[1L]93,W[X]CCC{ ]X

  [Tape pointer left]Z
  [D60,=U }[}<+-{]C{ ]X

  [Tape pointer right]Z
  [D62,=U }[}>+-{]C{ ]X

  [D43,=U }[}+D{,[)=U}0.{]X]C{ ]X

  [D45,=U }[}-D{,[N=U})-.{]X]C{ ]X

  [D44,=U }[}I.{]C{ ]X

  [D46,=U }[},O]C{ ]X


[Execute program]Z

External resources