Deadfish++

From Esolang
Jump to navigation Jump to search
Deadfish++
Paradigm(s) Functional
Designed by User:Europe2048
Appeared in 2023
Computational class Turing complete
Major implementations Unimplemented
File extension(s) .dfp

Deadfish++ is an esolang by Europe2048 which focuses on extending Deadfish.

Logo by PixelatedStarfish

Instructions & more

Commands
Command What it does
i Increases the current memory cell
d Decreases the current memory cell
s Squares the current memory cell
0 Resets the current memory cell
o Outputs the memory cell as a number (error if it's a string)
c Outputs the memory cell as a Unicode character, with no newline
S Outputs the memory cell as a string
l Move the memory pointer to the left
r Move the memory pointer to the right
n Print all the memory pointers as numbers in order
p Print all the memory pointers as characters in order
y Input a number and store its value in the current memory cell
u Input a string and store it in the current memory cell
ƒ Start of function definition. Next letter is the name of the function (letter that isn't a built-in function or whitespace).
( Opening loop: jump past the matching ) if the memory cell is 0 or ""
) Closing loop: jump at the matching ( if the memory cell isn't 0 or ""
[ Opening infinite loop
] Closing infinite loop
{ Start of comment
} End of comment
< Start of code in function definition
> End of code in function definition
f, e If and else, respectively. Syntax: f(condition):code e:code Conditional statements must be separated by spaces and ended with a semicolon.
a~b Store a into the variable b. b's name must be a Unicode character that isn't occupied by another function. The name also must not be a whitespace. Must be ended with a semicolon.
"a" String literal. Can be used in the a ~ b command and conditionals.
mvar Store a variable into the current memory cell.
tnumber Set the tab indentation to the specified number. Number must be one decimal digit greater than 0, in order not to break things.
Rvalue Return a value.
number Number literal.
[number] Read memory cell number number, and return it.
g(number) Goes to the corresponding memory cell.
h Break from a loop.
P Push: take the first character of string and put it to the right.
E Push from end: take the last character of string and put it to the right.
Escape sequences
Sequence Meaning
\n Newline
\t Tab
\r Carriage return
\b Backspace
\f Form Feed
\v Vertical Tab
\0 null
\? Replacement Character
\o Object Replacement Character
\" A literal quote
\\ A literal backslash
\hhhhh Unicode (base 16). Put a g in the first spot if it's 10xxxx.
\nnnnnn Unicode (base 10)
Statements and expressions
Statement/expr. Meaning
a = b Equal operator
a > b Greater than
a < b Less than
a + b Addition
a - b Subtraction
a * b Multiplication
a / b Division
a ^ b Exponents
a % b Modulo
@ a Square root
#aaa arguments seperated by spaces Other operations (a = letter/number)

List of other functions:

Example:
g xxx = Function name
(g = number of arguments)
1 sin = Sine
1 cos = Cosine
1 tan = Tangent
1 csc = csc
1 sec = sec
1 cot = cot
[^ Add 1 for inverse, and h for hyperbolic ^]
1 isn = Inverse sine
1 ics = Inverse cosine
1 itn = Inverse tangent
1 lg2 = Log base 2
1 lga = Log base 10
1 lge = Natural log
2 lgb = Log base n
1 fac = Factorial
0 pii = Pi
0 eee = e (number)
0 gdr = The Golden Ratio
0 gam = γ (number)
0 inf = Infinity
2 com = nCr
2 prm = nPr
2 rnd = Random integer
2 rdf = Random float
2 nrt = nth root
1 flr = Round down
1 cei = Round up
1 rou = Round
2 lcm = Least Common Multiple
2 gcd = Greatest Common Divisor
1 sgn = Sign of a number (-1 if negative, 1 if positive)
1 abs = Absolute value (this allows things like #abs a * #sgn a = a for true)
0 dgr = Convert to degrees
0 rad = Convert to radians
0 grd = Convert to gradians

Unlike Deadfish, memory pointers can be 256 or negative.

Unlike brainfuck, there are memory pointers with negative numbers (0th, -1st, -2nd...)

Unlike other cell-based languages, memory cells can contain strings.

Errors

Syntax error - Syntax error
Convert error - You can't convert a string to a number!
Unicode error - The character you're trying to output is out of range (>1,114,111 or <0)
Math error - Either the operation is invalid, or the expression returns an invalid result

Example programs

Hello, World!

"Hello, world!"~j;mjS

Cat program

uo

Truth machine

y~a;f(a = 0):0iiisddsdc;f(a = 1):0iiisdds[c]

Fibonacci

Repeats 50 times.

1~v;1~w;2~x;iiisddsi(w~v;x~w;v+w~x;)

Factorial

1~a;2~b;iiisddsi(mao;a*b~a;b+1~b;)

Real Quine

"~j;riisiisddclmjSrclmjo"~j;riisiisddclmjSrclmjo

Turing-completeness

Since Deadfish++ has all the commands from brainfuck, and brainfuck is turing-complete, then Deadfish++ is too.

Interepters

None yet.

See also