Jump to content

Wikifunctions:Catalogue/Logic operators

From Wikifunctions

These are the fundamental tools to control flow in your functions.

  • If (Z802): depending on whether the condition is true will return one or the other value
  • if (string output) (Z11542): if function (like Z802) typed with string types
  • if (natural number output) (Z13846): if function (like Z802) typed with number types
  • if (integer output) (Z17192): if function (like Z802) typed with integer types
  • iffy (Z15728): functions as “if”, so long as the condition is Boolean, otherwise it depends on the non-Boolean option
  • Triple if (Z19565): 2 if statements, designed so that you do not have to nest them in the weird way required with the built-in function. For ifs of greater values, see N-ifs (Z19602)
  • N-ifs (Z19601): An if statement any amount of times. See triple ifs (Z19565) for a clearer way to input 2 conditions, and built-in Z802 for 1 condition.
  • unless exception (Z20305): re-arrangement of if putting the else branch first and the condition second: else/Z802K3 if/Z802K1 then/Z802K2