Deadfish 3
Jump to navigation
Jump to search
- This language is a derivative of Deadfish.
Deadfish 3 is a superset of Deadfish 2 invented by User:A. As well as an accumulator, Deadfish 3 has a string which can be set using the input command.
Commands
Deadfish 3 has twelve commands, three of which are new.
Command | Description |
---|---|
i
|
Increment the accumulator. |
d
|
Decrement the accumulator. |
s
|
Square the accumulator. |
o
|
Output the accumulator. |
O
|
Output the clipboard. |
c
|
Output the accumulator as a character. |
n
|
Set the accumulator to 0. |
r
|
Read input and store it in the clipboard. |
h
|
Halt the innermost clipboard-pasted program enclosing the program counter (halts the whole program if there is no such program). |
"xx"
|
Copy the characters xx to the clipboard; this is assumed as one command.
|
@
|
Paste the content of the clipboard after this command. |
:
|
Execute the next command if the accumulator is 0. |
Examples
Hello world!
This program prints "Hello world".
iisiiiisiiiiiiiiciiiiiiiiiiiiiiiiiiiiiiiiiiiiiciiiiiiicciiicdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddcdddddddddddddddddddddsddcddddddddciiicddddddcddddddddch
Cat program
This program reads the input and copies it to the output.
rOh
Truth-machine approximation
This program remotely approximates the workings of a truth-machine by employing clipboard-pasted code segments and recursion in the same.
In order to operate correctly, the user must simulate a truth-machine input of 0 by issuing no input, or a value of 1 by committing a single i
command. Please heed that in Deadfish 3 implementations which realize subprogram executions via recursion a stack overflow is very probable.
"Please input 'i' to simulate '1', otherwise nothing: " O d r@ "iod@" :@ no
Interpreter
- Common Lisp implementation of the Deadfish 3 programming language.