Hárdfish
Jump to navigation
Jump to search
Hárdfish is an esolang invented by User:None1, inspired by Hardfish.
Almost all the specifications are the same, except two:
r
concatenates the rest of code to the code, then is removed from the code.- Two consecutive same characters are allowed.
Examples
Infinite loop
rr
The following program's source code gets longer exponetially for each instruction:
rrr
In fact, the program's length becomes 2i+2 characters long when i instructions are executed.
Due to the fact that this esolang can implement an infinite loop and a program that grows forever, implementing this esolang means that the implementing language is not total, and has infinite memory.
Interpreter
Python
code=input() x=0 while code: c=code[0] code=code[1:] if c=='i': x+=1 if c=='o': print(x) if c=='r': code+=code if c=='c': x=(3*x+1 if x%2 else x>>1) if c=='q': x=(2*x+1 if x%3 else x//3) if x in (-1,256): x=0