Skip to content

BrotherYuuta/Dualfish

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Dualfish Interpreter

Written by LandonThePancake in Python v3.12

Info

Dualfish is a esoteric programming language heavily inspired by another language named "deadfish". This language aims to add more to deadfish with the goal of making it slightly more interesting (whilst also making no god damn sense). 'Dual'fish gets its name from having two registers to work with instead of just one like deadfish. It really doesn't take rocket science to find out where the 'fish' part came from, so don't ask.

This is my first interpreter, and it definitely shows with how the code is structured, But im pretty proud of what i was able to pull off.

How to make something in Dualfish

you can type 'help' in the interpreter for a list of functions

So you wanna make something in Dualfish? Are you SURE you have nothing else you should be doing? No responsibilities to take care of? Alright then,
In Dualfish you have these things called "registers", two to be exact. Both of these hold a INT that start at 0 that can be modified to your liking. you can freely switch between these with the "<, >" commands, but I'll go over that a bit more later.

i and d

"i" stands for increment and adds 1 to the register, while "d" stands for decrement and subtracts 1 to the register.

Increment
Input: iiio
(register 1 will equal 3)

Decrement
Input: dddo
(register 1 will equal -3)

s and c

"s" stands for square, and squares the current register "c" stands for cube, and cubes the current register

Squaring
Input: iiiiso
(register 1 will equal 16)

Cubing
Input: iiiico
(register 1 will equal 64)

o, and 0

"o" stands for output, and outputs the value of the selected register. "0" doesnt stand for anything, but will display the value of both registers.

o
Input: iiisdo
Output: 8

0
Input: iiisd0
Output: [8, 0]

a

(you may need this: https://i.pinimg.com/736x/39/c7/11/39c71180679b0e5fa358fecc8d6c2682.jpg)
"a" stands for alphabet, and is a bit more complicated than the other functions. It outputs an alphabetical letter, corresponding to a registers current INT value. So 1 = a, 2 = b, 3 = c, etc... Once you break past 26, you get to capital letters. So 27 = A, 28 = B, 29 = C etc... And past 52, it crashes the interpreter! (I'll fix it later)
Input: iiiiiiiiaia
Output: hi

< and >

"<" switches the current register to 1, and ">" sets it to register 2.
Input: iiii>iiiii0
Output: [4, 5]

*

"*" simply doubles the value of the current register
Input: iii*o
Output: 6

+ and -

"+" adds the value from the unselected register to the selected one, and "-" subtracts the value of the unselected register from the selected one.

Adding
Input: ii>iiii+0
Output: [2, 6]

Subtracting
Input: >iiii<iiiii-0
Output: [1, 4]

f

"f" flips a registers positive and negative signs. It's also not in the help command for some reason. (I'll fix it later)
Input: iiifo
Output: -3

r

"r" resets the value of BOTH registers back to 0
Input: iiiii>iiiiir0
Output: [0, 0]

Full Examples

I'm not really going to teach you what kind of dark voodoo magic makes any of this work, but i thought it would be cool to show off nonetheless

Written by Me (smallest hello world i've made)
Input: iic**iiarii*ia>iii*i<+aa>dddd<+a>dddaiiiciiiiiii<+ariiii**da>iii<+a>*<-arii*a
Output: Hello World

Written by Techsec
Input: ii*i**>ii*isi<+arii**arii*iar>a<rii***iarii*i**iarii**iariiiarii*i*iar>a<riiariiis*arii*i*>ii*i<+arii*i**iiiarii*iii*ar>a<riii*arii*i*>ii*i<+arii***>ii**<+ar>a<ii*i**arii**arii*iar>a<iii**ariarii****>iii*<-arii*isar>a<ii*arii*i*>ii*i<+arii*>iii<+a
Output: The quick brown fox the lazy dog

Whats to come?

I dont plan on expanding this language too much more, but I'd love to add a form of input, as well as a way to read dualfish files. But yeah, I think thats everything. Have fun!

About

deadfish, but more.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Python 100.0%