If - then

This block allows you to create a condition: only if the statement (condition) next to if is true, then the blocks next to then will be executed.

You can customize this block and add multiple else if or an else by clicking on the + sign. Use the available options and drag and drop them to the right.


Comparing two numbers

With this block you can compare two numbers (to be added inside the holes). The result is either true or false.

Options:

  • =: is equal to
  • : is not equal to
  • <: is smaller than
  • : is smaller or equal than
  • >: is larger than
  • : is larger or equal than


Logical operations

This block allows you to make logical operations on two statements (conditions) (to be added inside the holes).

Options:

  • and: is true of both statements are true
  • or: is true if at least one of both statements is true


Logical negation

Returns true if the block on the right is false. Returns false if the block on the right is true.


True or false condition

Represents either true or false.


Null

Returns the value null. Can be used, for instance, to detect if a variable has already been initialised or not.


Shortcut for a condition

This block checks a statement (condition) added to test. If the statement is true, then the blocks next to if true then are executed. If it is false, then the blocks next to if false then are executed.


You can find a simple example for using the logic blocks in the sample project Rock-Paper-Scissors.

  • en/programmingblocks/logic.txt
  • Last modified: 2018/04/23 13:38
  • by kniwwelino