User:King Ethan

From Esolang
Jump to navigation Jump to search

User:King Ethan is a BF-derived language.


Note: Due to limitations of MediaWiki, this language had to be made into my user page.

Commands

The language's command repertoire constitutes a derivation of brainfuck's, yet deviating in those constituents relevant to the special input and output concept.

Instruction BF translation Description
[ < Move pointer left.
] > Move pointer right.
+ + Increment cell under pointer.
- - Decrement cell under pointer.
. N/A Access standard output (destination).
, N/A Access standard input (journey).
{ [ Jump past the matching } if the cell under the pointer is 0.
} ] Jump back to the matching { if the cell under the pointer is nonzero.
& N/A Access the value of the cell under the pointer (journey or destination).
> N/A Journey operator, assigns what's on the left to what's on the right.

Cells marked "N/A" are slightly harder to translate:

  • To get input, send the input to the current cell like this: ,>&, using the input, journey, and current cell operators.
  • To set output, send the current cell to the output in a similar fashion: &>.

Examples

The classical Hello World! program can be designed in this fashion:

++++++++{]++++{]++]+++]+++]+[[[[-}]+]+]-]]+{[}[-}]]&>.]---&>.+++++++&>.&>.+++&>.]]&>.[-&>.[&>.+++&>.------&>.--------&>.]]+&>.]++&>.

A traditional solution to the infinite cat program involves the following:

+{,>&&>.}

However, by utilization of the interrelation betwixt journey and destination, we might transmit the input (,) immediately to the output (.), skipping a temporary storage in a memory cell.

+{,>.}

Interpreter

  • Common Lisp implementation of the King Ethan programming language.