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.

Alan's dead fish

From Esolang
Jump to navigation Jump to search

(This is my first esolang, please note any mistakes.)

Alan's dead fish is an esolang make by User:Bogdan192848 based on Deadfish. It has the same command set as Deadfish, but with 2 new commands:

  • "!": If the accumulator isnt 0, jump to the next !. The even numbered ! are not runned (ex in !d!!i!, only the ! at the first and 4th character are runned)
  • "g": Set the accumulator to the user's input.

The program also loops when it reaches the end.

Examples

Truth-machine

!g!!oh!d!iod!i

Countdown

!g!od!oh!

Interpreters

Text form below, see as an image here.

define execute
set [pointer v] to (0)
set [acc v] to (0)
set [odd! v] to (1)
delete all of [OUT v]
forever
  change [pointer v] by (1)
  if <(pointer) > (length of (Code))> then
    set [pointer v] to (1)
  end
  if <(letter (pointer) of (Code)) = (i)> then
    change [acc v] by (1)
  else
    if <(letter (pointer) of (Code)) = (d)> then
      change [acc v] by (-1)
    else
      if <(letter (pointer) of (Code)) = (s)> then
        set [acc v] to ((acc) * (acc))
      else
        if <(letter (pointer) of (Code)) = (o)> then
          add (acc) to [OUT v]
        else
          if <(letter (pointer) of (Code)) = (h)> then
            stop [this script v]
          else
            if <(letter (pointer) of (Code)) = (!)> then
              if <<not <(acc) = (0)>> and <(odd!) = (1)>> then
                change [pointer v] by (1)
                repeat until <(letter (pointer) of (Code)) = (!)>
                  change [pointer v] by (1)
                end
              else
                set [odd! v] to ((1) - (odd!))
              end
            else
              if <(letter (pointer) of (Code)) = (g)> then
                ask [] and wait
                set [acc v] to (answer)
              end
            end
          end
        end
      end
    end
  end
end