We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

NotDeadfish

From Esolang
Jump to navigation Jump to search

NotDeadfish is a deadfish derivative by User:Cordership. The difference between this and Deadfish is the order of operations and the commands.

Commands

Command Meaning
i Increment
d Decrement
s Square
o Output
h Halt.

How it works

Take a program, for example:

iisisddo
  • The two first “i”s change the accumulator to 2.
  • The first “s” changes it to 4.
  • The third “i” changes it to 5.
  • The second “s” changes it to 25.
  • The 2 “d”s change it to 23.
  • The ”o” outputs the value of the accumulator, in the example program it is 23.
  • Using the order given by the steps to get the answer, we get iisisddo, which means the operations are executed from left to right.

Why this isn't deadfish

The program

iissso

prints 256 in this language, the program

diissisdo

prints 3 in this language, the program

iissisdddddddddddddddddddddddddddddddddo

prints 256 in this language.

Shortest constants

0   =
1   = i
2   = ii
3   = iii
4   = iis
5   = iisi
6   = iisii
7   = iisiii
8   = iiisd
9   = iiis
10  = iiisi
11  = iiisi
12  = iiisii
13  = iiisii
14  = iiiisdd

Interpreter

Python:

n = input("Input NotDeadfish code: ")
acc = 0
import sys
for x in n:
    match x:
        case "i":
            acc += 1
        case "d":
            acc -= 1
        case "s":
            acc **= 2
        case "o":
            print(acc)
        case "h":
            sys.exit()