π The Fyshhiker's Guide to the Ocean π
π©βπ» How to Compile and Run Fysh
βοΈ Option 1: Using VSCode
- Download the
FyshVSCode extension. - Create a
.fyshfile. - Write your code.
- Press the run button.
βοΈ Option 2: Using Command Line
- Install the latest version
go install github.com/Fysh-Fyve/fysh@latest - Execute with
fysh <filename>.fysh.
π Fyshing Manual
π Chapter 1: Fysh Syntax
π Variables
- Meet Steven, our fishy friend. In Fysh, variables like Steven are declared
with
><name>. Every line of fysh ends with a wave~.
><Steven> ~
- Steven has binary scales. In Fysh,
}represents1and)represents0. Here, Steven is valued at0b101, which is5in decimal.
><steven> = ><})}> ~
- Steven doesnβt give a flying fysh about scale direction.
βfor variable assignment is cool with them too.
><steven> β ><}({> ~
ποΈ Optional Visuals
- Steven is blind. You have the power to bless them with sight, but it's completely optional! You can make them biblically accurate by giving them multiple eyes.
><steven> β ><{({Β°> ~
><steven> β ><{({o> ~
><steven> β ><{({°°> ~
><steven> β ><{({oΒ°> ~
><steven> = ><{({Β°oΒ°> ~
β Arithmetic with Variables
- Summing values: A school of Fysh's value is the sum of each member. This
gives Steven a value of
0b101 = 0b100 + 0b001 =(5 = 4 + 1).
><steven> β ><{((Β°> ><(({Β°> ~
- Subtracting values: Sometimes fysh are negative and start to swim
backwards. This takes away from the school's value. Steven's value is
0b101 = 0b111 - 0b010(5 = 7 - 2).
><steven> β ><{{{Β°> <Β°)})>< ~ # 0b101 = 0b111 - 0b010
- Multiplying values: Fysh often get lonely. This loneliness causes fysh to
meet new fysh and proliferate. This gives Steven a value of
0b101010 = 0b110 * 0b111. (42 = 6 * 7)
><steven> = ><{{(Β°> <3 ><{{{Β°> ~
><steven> β ><{{(Β°> β‘ ><{{{Β°> ~
- Dividing values: Not every fysh story is a happy one. At times, separation
is inevitable, and their division breaks their heart. This gives Steven a
value of
0b101 = 0b11001 / 0b101. (5 = 25 / 5)
><steven> β ><{{(({Β°> </3 ><{({Β°> ~
><steven> β ><{{(({Β°> π ><{({Β°> ~
- Using parentheses for complex operations: Fysh are often abducted and
isolated into fyshbowls
( )for terrestrials' amusment. This makes the fysh sad and gives Steven a value of0b101 = 0b101 / (0b101 - 0b100). (5 = 5 / (5 - 4))
><steven> β ><{({Β°> π ( ><{({Β°> <Β°}))>< ) ~
πΌπ½ Increment and Decrement
- Increment: As life goes on, we learn from our mistakes and improve. Stevenβs self help journey allowed them to grow an extra tail, incrementing their value by 1.
>><steven> ~
- Decrement: Sometimes we feel like a fyshup, a failure. And that's ok, itβs a part of being fysh. However for some fysh, this feeling is too much to handle and is internalized. They havenβt received the emotional support they need and have gone on a downward spiral, causing them to feel worthless. They begin to retreat and try to swim away in the opposite direction causing their value to decrement by 1.
<steven><< ~
π’ Random Number Generation
Random Number: This is a grilled fysh. It generates a random signed 32-bit number that determines the doneness of the fysh.
><####> ~
π Chapter 2: Data Types
π Integers
- Integer: Steven is an integer represented using binary scales. They have
scales that are either
1or0. Steven's value is0b101, which is5in decimal.
><steven> β ><{({Β°> ~
π Floating Point Numbers
- Floats: Steven can also be a float fysh. To seperate the integer and
decimal parts, we use a fysh bone
-. Steven's value is5.5.
><steven> β ><{({-{({Β°> ~
- Floats with multiple bones: Steven can also have multiple bones to
seperate each decimal place. Steven's value is
5 + 0.2 + 0.05 = 5.25.
><steven> β ><{({-{(-{({Β°> ~
- Floats with numbers larger than 9: If a value in the decimal place is
greater than 9, it will occupy an extra decimal place. Steven's value is
15 + 0.15 + 0.005 15.155.
><steven> β ><{{{{-{{{{-{({Β°> ~
π Strings
- Strings: Steven can also be a string fysh. They speak using bubbles.
Steven's value is
"Hello, World!".
><steven> β π«§Hello, World!π«§ ~
π¦ Arrays and Traversal
- Arrays: A fysh tank
[ ]is used create an array. Each item is separated by fysh food -.value is[0b010, 0b010] = [2, 2].
><steven> β [><({(Β°> - ><({(Β°>] ~
- Accessing Array Elements: These fysh tanks can be traversed using a fysh
tank
[ ]with a number inside it. Steven returns the element at index 1. Array indexes start at 0.
><steven>[><(({Β°>] ~
π§ Chapter 3: Fysh Logic and Operations
π€ Logical Operations
AND (&&),OR (||), andNOT (!!): Steven is experiencing an existential crisis. They're questioning the very fabric of reality.- If steven is real
andthey found the truth, they're happy. (Steven && theTruth) - Steven is happy if either they're real
orfound the truth. (Steven || theTruth) - But then Steven thought about it and said "hey it would be kinda cool if I
wasn't real" and is now only happy if they're
notreal. (!!Steven)
- If steven is real
><steven> && ><TheTruth> ~
><steven> || ><TheTruth> ~
!! ><steven> ~
π§ Bitwise Operations
- Steven is bored and looking to have their bits rearranged. At Fysh, we're
hereto help! We have provided Steven with a variety of tools and bitwise
manipulations to satisfy their bit busting needs:
AND (&)OR (|)XOR (^)NOT (!)
><steven> & ><(({Β°> ~
><steven> | ><(({Β°> ~
><steven> ^ ><(({Β°> ~
! ><steven> ~
- Logical shifts: Steven can also use logical shifts! Steven shifts their
bits to the left then right by 1.
- Left shift (
<<): - Right shift (
>>):
- Left shift (
><steven> << ><(({Β°> ~
><steven> >> ><(({Β°> ~
πΈ Tadpoles
Tadpoles are Fysh too. They swim towards bigger Fysh (they like the danger) and
are represented by ~o or o~. Here, we are checking if Steven is bigger than
5 and less than 7, respectively.
><//> Greater/Less than
><steven> o~ ><{({Β°>
><steven> ~o ><{{{Β°>
><//> Greater/Less than or equal to (replace ~ with β or =)
><steven> o= ><{({Β°>
><steven> βo ><{{{Β°>
π Chapter 3: Control Structures
π While Loops
- In the whirlpool of Fysh logic, the while loop, represented by
@orπ, with the condition stored in either[ ]or( ). Small fysh define the iterative heart><>and<><.
Here we repeat the loop while Steve is greater than 5. Steven decrements by 1 each iteration.
π [><steven> o~ ><{((Β°>]
><>
<steven><< ~
<><
@ (><steven> o~ ><{((Β°>)
><>
<steven><< ~
<><
β Conditional Statements
Conditional statements run based on how each Fysh feels
ifstatement: are happy since they're the condition you're looking for. They feel wanted and loved. They are represented by a happy Fysh
><(((^> [><steven> o~ ><{((Β°>]
><>
<steven><< ~
<><
elsestatement: feel like they're the last resort, an afterthought. This makes them feel unimportant and sad. They are represented by a dead Fysh
><(((*>
><>
><steven> β ><(((Β°> ~
<><
else ifstatement: are the middle child. They're not the first choice, but they're not the last either. They're represented by both a dead and happy Fysh
><(((*> ><(((^> [><steven> ~o ><{((Β°>]
><>
>><steven> ~
<><
π§βπ§ Chapter 4: Functions
βοΈ Defining Functions
To define a function or SUBroutine, use a submarine >(funcNameHere) along with
any parameters ><param>. To return a value, use a squid <~ or π¦.
Here the function is called submarine and has 3 parameters. It returns the sum
of the 3 parameters.
>(submarine) ><param1> ><param2> ><param3>
><>
<~ ><param1> ><param2> ><param3> ~
<><
π Calling Functions
- To call a subroutine, put the submarine in a Fysh tank along with its
arguments. If two or more params are next to each other, separate them with
Fysh food
-.
[>(submarine) ><fysh1> - ><fysh2> - ><fysh3>] ~
β Chapter 5: Output
βοΈ Output Value
When we finally reach our destination, we anchor ourselves. Anchors are used to
output the value of a Fysh. They are represented by (+o or β
Here we're outputting 0b101 (5).
(+o ><{({Β°> ~
π¬ Chapter 6: Comments
π Single-line Comments
Navigator Fysh are used to guide the reader through the code. They are
represented by ><//>.
><//> What's cookin' good lookin'?
π Multi-line Comments
For longer explanations, multiline comments are used. They are represented by
></*> and <*\><
></*>
How to grill a Fysh:
1. Catch a Fysh
2. Grill the Fysh
3. Eat the Fysh
<*/><
π Examples
βFactorial Example
This program calculates the factorial of number. In this case 5. The factorial of 5 is 120.
><//> Factorial Example
><number> β ><{({Β°> ~
><factorial> β ><(({Β°> ~
π [><number> o~ ><(({Β°>]
><>
><factorial> β ><factorial> β‘ ><number> ~
<number><< ~
<><
(+o ><factorial> ~
Let's break it down:
><number> β ><{({Β°> ~- Declare the number to calculate the factorial of. (5 in this case)><factorial> β ><(({Β°> ~- Declare the factorial variable. (1 in this case)π [><number> o~ ><(({Β°>]- While the number is greater than 1, do the following:><factorial> β ><factorial> β‘ ><number> ~- Multiply the factorial by the number.<number><< ~- Decrement the number.- Repeat until the number is 1.
(+o ><factorial> ~- Output the factorial.

Log in or sign up for Devpost to join the conversation.