Skip to main content

πŸ“Š Chapter 2: Data Types

πŸ“ Integers​

  • Integer: Steven is an integer represented using binary scales. They have scales that are either 1 or 0. Steven's value is 0b101, which is 5 in 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 is 5.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>[><(({Β°>] ~