Difference between revisions of "Mixly Block Category - Logic"

From Microduino Wiki
Jump to: navigation, search
(Equality Comparison)
(Relational Operators)
Line 38: Line 38:
 
Example 3: [5 '''≤''' 4], returns '''false'''.
 
Example 3: [5 '''≤''' 4], returns '''false'''.
  
 +
==Greater Than==
 +
Compares the '''Left Input''' is greater than the '''Right Input'''. If correct, then '''true''' is returned, otherwise '''false''' is returned.
  
 +
Example 1: [5 '''>''' 6], returns '''true'''.
  
[], returns '''true'''
+
Example 2: [5 '''>''' 5], returns '''false'''.
 +
 
 +
Example 3: [5 '''>''' 4], returns '''true'''.
 +
 
 +
==Greater Than Or Equal==
 +
Compares the '''Left Input''' is greater than or equal to the '''Right Input'''. If correct, then '''true''' is returned, otherwise '''false''' is returned.
 +
 
 +
Example 1: [5 '''≥''' 6], returns '''false'''.
 +
 
 +
Example 2: [5 '''≥''' 5], returns '''true'''.
 +
 
 +
Example 3: [5 '''≥''' 4], returns '''true'''.
  
 
=Boolean Operations=
 
=Boolean Operations=

Revision as of 01:24, 16 February 2017

Relational Operators

Takes two inputs -- left and right. Performs the requested relational operator (see below). If the statement is true (correct), then a boolean true is returned. If false (incorrect), then a boolean false is returned.

  • Left Input - The first value that will be used in the relational statement.
  • Relational Operator - The operator used -- equal, not equal, less than, left than or equal, greater than, greater than or equal.
  • Second Input - The second that will be used in the relational statement.

Equal

Compares the two inputs for equality. If equal, then true is returned, otherwise false is returned.

Example 1: [5 = 5], returns true.

Example 2: [5 = 6], returns false.

Not Equal

Compares the two inputs being different. If different (not equal), then true is returned, otherwise false is returned. This is the reverse of the Equal operator.

Example 1: [5 5], returns false.

Example 2: [5 6], returns true.

Less Than

Compares the Left Input is less than the Right Input. If correct, then true is returned, otherwise false is returned.

Example 1: [5 < 6], returns true.

Example 2: [5 < 5], returns false.

Example 3: [5 < 4], returns false.

Less Than Or Equal

Compares the Left Input is less than or equal to the Right Input. If correct, then true is returned, otherwise false is returned.

Example 1: [5 6], returns true.

Example 2: [5 5], returns true.

Example 3: [5 4], returns false.

Greater Than

Compares the Left Input is greater than the Right Input. If correct, then true is returned, otherwise false is returned.

Example 1: [5 > 6], returns true.

Example 2: [5 > 5], returns false.

Example 3: [5 > 4], returns true.

Greater Than Or Equal

Compares the Left Input is greater than or equal to the Right Input. If correct, then true is returned, otherwise false is returned.

Example 1: [5 6], returns false.

Example 2: [5 5], returns true.

Example 3: [5 4], returns true.

Boolean Operations

Not (Negation)

Boolean Values

null Value

... if true ... if false ...