Deadfish-33
Deadfish-33 is a programming language I made in my free time. It takes inspiration from I walk away! and it's Deadfish, but with 33 commands (hence the name) and a 2-dimensional memory with its own pointer.
| Instruction | Meaning |
|---|---|
| i | Increment the current cell by 1. |
| d | Decrement the current cell by 1. |
| s | Square the current cell. |
| c | Cube the current cell. |
| o | Output the numerical value of the current cell. |
| O | Output the ASCII value of the current cell. |
| q | Take the root of the current cell. |
| 0 | Reset the current cell. |
| 2 | Double the current cell. |
| 3 | Triple the current cell. |
| x | Print "x" to the console/terminal. (just for the quines) |
| / | Halve the current cell. |
| \ | Third the current cell. (divide by 3) |
| ; | Go back to the start unless specified otherwise and read until the next ; command, not the current one, unless it is the last ; command. |
| I | Increment the current cell by 2. |
| D | Decrement the current cell by 2. |
| x y b a | Move in the +x, +y, -x, or -y directions. |
| ? | Move in a random direction. |
| j | Asks the user for input. |
| . , | The bunny operator and its inverse. |
| r | Random integer. |
| + - * / % | Mathematical operators. |
| @ | Make 3 new pointers, so that there are 4 pointers going in each of the 4 directions, +x, +y, -x, and -y. |
| ! | Terminate a pointer |
| w | Set the current cell to a given value. |
How to format the bunny operator
The bunny operator is formatted as
.{}{}{}{}{}
or
,{}{}{}{}{}
where the first four curly-bracket pairs are two pairs of coordinates for two cells. Calling the values of those cells d1 and d2, and the number in the fifth pair d3, bunny(d1, d2) = ((d1 * d2) % (d1 + d2)) % d3, and inverse bunny(d1, d2) = (int(d1 / d2) % (d1 - d2)) % d3.
Error codes and formatting/syntax
Every line (with a line number n) must have exactly n spaces, then exactly n characters. This excludes comments, which are marked with a $ sign such as
$ This is a comment which will not be counted as part of the character count $
If even one line does not adhere to that requirement, you get
Error code 1 on line n: well now i am not doing it
where n is the line number.
The r command must have arguments for a lower and upper bound. With the j command, it's optional. The w command needs 1 argument for what to set the cell to. If there are multiple pointers at a time, you must specify which ones to use with additional arguments at the end. The bunny and inverse bunny operators need 5 arguments each. Fractions/irrationals aren't outlawed, but they can cause annoying floating-point errors. If you don't adhere to that, you get
Error code 2 on line n at command c: i dont get your code
where n is the line number and c is the command number, e.g. if you see the message
Error code 2 on line 5 at command 4: i dont get your code
it means that the 4th command on line 5 has a syntax error in it.
Pointer numbers go as follows: The pointers are numbered in chronological order, with the original being 0. Since multiple pointers are made at once in a @ command, the one which took a left turn gets the smaller number, then comes the one that made a right turn. If there are ever more than 1048576 pointers in the (infinite) 2D memory plane, you get
Error code 3 on line n at command c: too much pointers for me
with the same n and c as for error code 2.
Example programs
$ The lazy way, using the # symbol as a no-op to avoid error code 1 $
w
{7
2}O
0w{1
01}O0
w{108}
O0w{108
}O0w{111
}O0w{44}O
0w{32}O0w{
119}O0w{111
}O0w{114}O0w
{108}O0w{100}
O0w{33}O0#####
Infinite looping counter (decimal rather than unary)
i o;
Computational class
Clearly it isn't Turing Complete, because it can't even do if-else statements. I have planned an extension which you can call with the line ^cx, which adds the following 3 commands:
| Instructions | Meaning |
|---|---|
| " | If (format is "{condition}) |
| ' | Else (format is '{condition}) |
| _ | Elif (format is _{condition}) |
Combined with the looping mechanic, the ^cx-extended version, which I'll call Deadfish36, may just be Turing Complete. Obviously it is Plushie Complete and Crystal Complete, but it would be pretty cool if it were Turing Complete. If it is, I'll be really happy, so make sure to let me know if you find out on my talk page.