< Language Tutorials

Document stub.png This article is a stub. It may be incomplete, unfinished, or have missing parts/sections. If the article can be expanded, please do so! There may be suggestions on its talk page. (August 2018)

This Ruby tutorial talks about operators, such as +, -, /, *, etc.

Math Operators

Here is a list of the math operators in Ruby, and what they are in Scratch.

  • x + y
    • Adds x and y.
    • In Scratch: ((x) + (y))
  • x - y
    • Subtracts y from x.
    • In Scratch: ((x) - (y))
  • x * y
    • Multiplies x and y.
    • In Scratch: ((x) * (y))
  • x / y
    • Divides x and y.
    • ((x) / (y))
  • x ** y
    • This is x to the power of y.

Operators Such as And, Or, Etc.

  • x > y || y > x
    • Is x greater than y or y greater than x? If either of them are, x > y || y > x equals true. If neither of them are, returns false.
    • In Scratch: <<(x) > (y)> or <(y) > (x)>>