Consequential

From Esolang
Jump to navigation Jump to search

Consequential is a language created by User:Xanman12321 which is a variant of Brainfuck, however each command does something unwanted.

Instructions

Command Description
> Decrement the previous cell and move the pointer right.
< Set the current cell to zero and move the pointer left.
+ Increment the current cell and move the pointer left twice.
- Decrement the current cell and increment the previous and next cell.
. Output an ASCII character signified by the current cell's value modded with 96 plus 32 and move the pointer right until the current cell is zero.
, Stores the standard input in the cells in front of and behind the current cell
[ Changes the previous cell to four and jumps to the matching ] if the current cell is zero.
] Changes the cell four ahead to the current cell value floor divided by two and jumps to the matching [ if the current cell is not zero.

Examples

Print letter “A”

This program utilizes the output character code translation formula in order to print the character “A” by setting the current cell value to 32, which is converted to the number 65 during the output operation, thus yielding the desired ASCII letter:

+>> +>> +>> +>> +>> +>> +>> +>> +>> +>> +>> +>> +>> +>> +>> +>> +>>
+>> +>> +>> +>> +>> +>> +>> +>> +>> +>> +>> +>> +>> +>> +>> +>> .

Cat program

The following source code implements an infinitely repeating cat program that, however, outputs the translated characters without correction — input and output will perforce vary:

<,>.<[<,>.<]

Interpreter

  • Common Lisp implementation of the Consequential programming language.