Line 7: Line 7:
 
|type = [[Boolean Block|Boolean]]
 
|type = [[Boolean Block|Boolean]]
 
}}
 
}}
The '''() < ()''' is an [[Operators Blocks|Operators block]] and a [[Boolean Block|Boolean block]]. The [[Blocks|block]] checks if the first value is less than the second value - if it is less, the block returns ''true''; if it is not, it returns ''false''.
+
The '''() < ()''' block is an [[Operators Blocks|Operators block]] and a [[Boolean Block|Boolean block]]. The [[Blocks|block]] checks if the first value is less than the second value - if it is less, the block returns ''true''; if it is not, it returns ''false''.
  
 
This block works with letters too, not just numbers - in [[Scratch]], letters at the top of the alphabet (ie. a, b, c) are worth less than letters at the end (ie. x, y, z). In [[Scratch 1.3]] and lower, it only accepted numbers.
 
This block works with letters too, not just numbers - in [[Scratch]], letters at the top of the alphabet (ie. a, b, c) are worth less than letters at the end (ie. x, y, z). In [[Scratch 1.3]] and lower, it only accepted numbers.

Revision as of 18:18, 21 February 2011

The correct title of this article is () < (). The Scratch Wiki uses this different title because of technical restrictions.
() < ()
() is less than ().png
Category Operators
Type Boolean

The () < () block is an Operators block and a Boolean block. The block checks if the first value is less than the second value - if it is less, the block returns true; if it is not, it returns false.

This block works with letters too, not just numbers - in Scratch, letters at the top of the alphabet (ie. a, b, c) are worth less than letters at the end (ie. x, y, z). In Scratch 1.3 and lower, it only accepted numbers.

Workaround

The block can be replicated with the following code:

File:Workaround for the () is less than () block.png

Example Uses

If a group of numbers must be arranged in size, this block can easily do the job.

Some common uses for the () < () block are below:

  • Arranging a set of numbers/letters
  • Evaluating numbers/letters
  • Comparing different variables (eg. comparing two characters' health in a game)

See also

Cookies help us deliver our services. By using our services, you agree to our use of cookies.