Fucktion

From Esolang
Jump to navigation Jump to search

Fucktion is an esolang created by islptng.

Intro

We have only parenthesis. Other characters are considered as comments.
Each program are computed by calling function f(). Arguments are passed without punctuation or spaces.
Example:

(()(())(()()))

Calls:

f(f(),f(f()),f(f(),f()))

Depending on the number of arguments, f() performs differently.

We have a dictionary to store variables. Like some of my other esolangs, numbers are fractions.
Writting to variable infinity causes a character to be printed to stdout, and reading from it returnes a character from stdin.

f()

No. of args Meaning
0 Evaluates to 1.
1 Evaluates to variable[arg1].
2 Sets variable[arg1] to arg2. Evaluates to arg2.
3 Evaluates to arg1/arg2-arg3.
4+
j = lambda a,b,c: (a<=b + b<=c + a<=c) % 2
cnt = 0
while not j(arg1,arg2,arg3):
    for i in args[3:]: evaluate(i)
    cnt += 1
return cnt

Turing Completeness

Brainfuck conversion:

(start) = ((()()())())
> = ((()()())(((()()()))()((()()())()())))
< = ((()()())(((()()()))()())
+ = (((()()()))((((()()())))()((()()())()())))
- = (((()()()))((((()()())))()()))
, = (((()()()))(()(()()())()))
. = ((()(()()())())((()()())))
[ = ((()()())(((()()())))(()()())
] = )