Fysh

🐙 Fyshing Manual

🐠 Chapter 1: Fysh Syntax

Click to expand

🐟 Variables

><Steven> ~
><steven> = ><})}> ~
><steven> ≈ ><}({> ~

👁️ Optional Visuals

><steven> ≈ ><{({°> ~
><steven> ≈ ><{({o> ~
><steven> ≈ ><{({°°> ~
><steven> ≈ ><{({o°> ~
><steven> = ><{({°o°> ~

➕ Arithmetic with Variables

><steven> ≈ ><{((°> ><(({°> ~
><steven> ≈ ><{{{°> <°)})>< ~  # 0b101 = 0b111 - 0b010
><steven> = ><{{(°> <3 ><{{{°> ~
><steven> ≈ ><{{(°> ♡ ><{{{°> ~
><steven> ≈ ><{{(({°> </3 ><{({°> ~
><steven> ≈ ><{{(({°> 💔 ><{({°> ~
><steven> ≈ ><{({°> 💔 ( ><{({°> <°}))>< ) ~

🔼🔽 Increment and Decrement

>><steven> ~
<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

Click to expand

📏 Integers

><steven> ≈ ><{({°> ~

📐 Floating Point Numbers

><steven> ≈ ><{({-{({°> ~
><steven> ≈ ><{({-{(-{({°> ~
><steven> ≈ ><{{{{-{{{{-{({°> ~

📝 Strings

><steven> ≈ 🫧Hello, World!🫧 ~

📦 Arrays and Traversal

><steven> ≈ [><({(°> - ><({(°>] ~
><steven>[><(({°>] ~

🧠 Chapter 3: Fysh Logic and Operations

Click to expand

🤔 Logical Operations

><steven> && ><TheTruth> ~
><steven> || ><TheTruth> ~
!! ><steven> ~

🔧 Bitwise Operations

><steven> & ><(({°> ~
><steven> | ><(({°> ~
><steven> ^ ><(({°> ~
! ><steven> ~
><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

Click to expand

🔁 While Loops

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

><(((^> [><steven> o~ ><{((°>]
><>
    <steven><< ~
<><
><(((*>
><>
    ><steven> ≈ ><(((°> ~
<><
><(((*> ><(((^> [><steven> ~o ><{((°>]
><>
    >><steven> ~
<><

🧑‍🔧 Chapter 4: Functions

Click to expand

✏️ 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

[>(submarine) ><fysh1> - ><fysh2> - ><fysh3>] ~

⚓ Chapter 5: Output

Click to expand

⛓️ 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

Click to expand

🔉 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

Click to expand

❗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:

  1. ><number> ≈ ><{({°> ~ - Declare the number to calculate the factorial of. (5 in this case)
  2. ><factorial> ≈ ><(({°> ~ - Declare the factorial variable. (1 in this case)
  3. 🌀 [><number> o~ ><(({°>] - While the number is greater than 1, do the following:
    1. ><factorial> ≈ ><factorial> ♡ ><number> ~ - Multiply the factorial by the number.
    2. <number><< ~ - Decrement the number.
    3. Repeat until the number is 1.
  4. (+o ><factorial> ~ - Output the factorial.