2.+-
Jump to navigation
Jump to search
2.+- is a variation of Deadfish, marked a divergent naming of the commands, as well as the contingency for defining aliases for characters.
Commands
It has the following commands:
Command | Result | Deadfish equivalent | Notes |
---|---|---|---|
2 |
Square the accumulator | s |
|
. |
Print the accumulator as a character | o |
2.+- prints the character associated with the accumulator as its code, whereas Deadfish outputs the accumulator in its verbatim numeric form. |
+ |
Increment the accumulator | i |
|
- |
Decrement the accumulator | d |
|
= |
Create an alias for another command | None |
Examples
An approximate Deadfish implementation can be realized by the alias command =
. Please note that 2.+- diverges from Deadfish by printing the character associated with the accumulator, not the numeric value itself.
s=2 o=. i=+ d=- Then, you can insert any Deadfish code here.
Hello world using the Deadfish interpreter
The following program emulates a Deadfish “Hello, World!” program by utilizing the alias definition, producing “Hello world”:
s=2o=.i=+d=-iisiiiisiiiiiiiioiiiiiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiooiiiodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddodddddddddddddddddddddsddoddddddddoiiioddddddoddddddddo
Hello world
This program prints “Hello world” utilizing the instruction set inherent to 2.+-:
++2++++2++++++++.+++++++++++++++++++++++++++++.+++++++..+++.-------------------------------------------------------------------------------.---------------------2--.--------.+++.------.--------.
Interpreter
- Common Lisp implementation of the 2.+- programming language.