Less Than Or Equal To: Difference between revisions
(Marked this version for translation) |
(duplicate file already uploaded) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<languages/> | <languages/> | ||
<translate> | <translate> | ||
<!--T:3--> | |||
<section begin="image"/>[[File:less_than_or_equal_to.png|alt=The Less Than Or Equal To Block|thumb]]<section end="image"/> | |||
==Usage== <!--T:4--> | |||
<!--T:2--> | <!--T:2--> | ||
<p id="tooltip">Determines if the first input is less than or equal to the second input and returns true or false.</p> | <p id="tooltip">Determines if the first input is less than or equal to the second input and returns true or false.</p> | ||
==Syntax== <!--T:5--> | |||
<!--T:6--> | |||
Inputs in this block: | |||
#a number | |||
#a number | |||
==Example== <!--T:7--> | |||
<!--T:8--> | |||
[[File:if_else_example.gif|alt=Less Than Or Equal To example gif|thumb]] | |||
[[File:less_than_or_equal_to_example.png|alt=Less Than Or Equal To example code|thumb]] | |||
<!--T:9--> | |||
This is a model of a hungry frog attempting to catch two different types of fly. While ‘fly around’ is toggled, the frog moves toward the closest fly. The fly detects whether the frog is nearby and will move in the opposite direction. The <= block is used to determine the speed of each fly based on the size of each agent. In this case, large flies are fast, whereas small flies are slow. It can be seen from the line graph that the population of the larger, faster flies decreases more slowly than the smaller, slower flies. | |||
==Related Blocks== <!--T:10--> | |||
<!--T:11--> | |||
*[[Special:MyLanguage/Greater Than Or Equal To|>=]] | |||
<!--T:1--> | <!--T:1--> |
Latest revision as of 18:11, 16 August 2023
Usage
Determines if the first input is less than or equal to the second input and returns true or false.
Syntax
Inputs in this block:
- a number
- a number
Example
This is a model of a hungry frog attempting to catch two different types of fly. While ‘fly around’ is toggled, the frog moves toward the closest fly. The fly detects whether the frog is nearby and will move in the opposite direction. The <= block is used to determine the speed of each fly based on the size of each agent. In this case, large flies are fast, whereas small flies are slow. It can be seen from the line graph that the population of the larger, faster flies decreases more slowly than the smaller, slower flies.