We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Livingfish

From Esolang
Jump to navigation Jump to search

Livingfish is an esolang based on Deadfish, but it is designed for golfing and has had more capabilities added to it. For example, input in Deadfish does not exist but it does in Livingfish.

Syntax and Features

Whitespace does not matter in Livingfish and commands may be on one line, spaced out like regular code, or made into any shape. All Deadfish programs are functional in Livingfish, and backwards compatibility is required to make sure that programs can reasonably run. Livingfish has 3 registers: a, x, and y. The default is a whenever an argument is not mentioned, but you may append the register being used to the end of the command. These registers can hold any value from 0 to 65536, and are automatically initialised to 0. In Livingfish, a register may hold an integer or a character and the contents may be outputted. The input is automatically placed in the y register, and all registers may be pushed and popped onto the stack. Livingfish is derived from the standard version most commonly used by the Deadfish community. Functions can be defined with arguments, at maximum: 2. These functions can return and goto other functions. If a program is functionless, it begins at the start. However, if a program does have a function, it will always begin at e; this is the entry point function, like main() in C. If/while statements use postfix and use the following instructions: +, -, *, /, %, =, >, <. Square brackets are used to mark blocks affected by if/while statements.

Instructions

Livingfish Instruction Set
i increment
d decrement
s square
o output
h halt
p pop
u push
m move
n input
g goto
f if
w while
e define function
r return
l else

Examples

Hello World:

mHomeomlomlomoom omwomoomromlomdom!.h

Fizzbuzz:

wx100<[fx15%0=[mFomBo]lfx5%0=[mBo]lfx3%0=[mFo]ix]h

Deadfish Interpreter:

wa0=[fni=[ix]lnd=[dx]lns=[sx]lno=[ox]l[h]]h