Livefish

From Esolang
Jump to: navigation, search

Livefish is an esoteric programming language made by Areallycoolusername. It's the opposite of Deadfish in that it has a way to input things but not output them.

Commands

The commands are mostly the same as the commands from Deadfish. Except for "o", which now inputs things rather than output them. Command "h" can still be used to halt the program. Here is the chart of commands.

Deadfish Function Livefish Function
i increments i increments
d decrements d decrements
s square s square
o output o input

Implementations

There is one interpreter for Livefish, and it's in Pascal. Here it is.

program Livefish (input,output);
uses crt;
var
coke : integer;
cook : char;
crak : string;
begin
repeat
coke := 0;
readln(Cook);
if(cook='i')then
coke := coke + 1;
if(cook='d')then
coke := coke - 1;
if(cook='s')then
coke := sqr(coke);
if(cook='o')then
readln(crak);
if(coke=256)then
Coke := 0;
if(coke<0)then
coke := 0;
until cook='h';
end.

However, two more interpreters are added for Livefish by User:A.

C

#include <stdio.h>
int main()
{
    int ac=0;
    char c;
    while(c!='h')
    {
        c=getchar();
        if(c=='i')ac++;
        else if(c=='d')ac--;
        else if(c=='s')ac*=ac;
        else if(c=='i')scanf("%d",&ac);
        if(ac==256||ac<0)ac=0;
    }
    return 0;
}

Lua

while cmd~="h" do
    if ac==256 or ac<0 then ac=0 end
    cmd=io.read()
    if cmd=="i" then ac=ac+1 end
    elseif cmd=="d" then ac=ac-1 end
    elseif cmd=="s" then ac=ac*ac end
    elseif cmd=="i" then ac=io.read() end
end

Hello World

The hello world program in Deadfish is still valid in Livefish, but this time it doesn't output anything since Livefish doesn't have any output capabilities. So it would be like:

input
iisiiiisiiiiiiiioiiiiiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiooiiio
dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddo
dddddddddddddddddddddsddoddddddddoiiioddddddoddddddddo
output

Computational Properties

Due to the lack of output capabilities, Livefish isn't Turing-complete as it can't do much of the things a Turing machine can.

A Turing-complete programming language does not require output capabilities. It is instead Turing-incomplete because it cannot execute an Infinite loop.