Greater Than: Difference between revisions
(updates from Blockument) |
(duplicate file already uploaded) |
||
(One intermediate revision by the same user not shown) | |||
Line 2: | Line 2: | ||
<translate> | <translate> | ||
<!--T:3--> | |||
<section begin="image"/>[[File:greater_than.png|alt=The Greater Than Block|thumb]]<section end="image"/> | <section begin="image"/>[[File:greater_than.png|alt=The Greater Than Block|thumb]]<section end="image"/> | ||
==Usage== | ==Usage== <!--T:4--> | ||
<!--T:2--> | <!--T:2--> | ||
<p id="tooltip">Determines if the first input is greater than the second input and returns true or false</p> | <p id="tooltip">Determines if the first input is greater than the second input and returns true or false</p> | ||
==Syntax== | ==Syntax== <!--T:5--> | ||
<!--T:6--> | |||
Inputs in this block: | Inputs in this block: | ||
#a number | #a number | ||
#a number | #a number | ||
==Example== | ==Example== <!--T:7--> | ||
[[File: | <!--T:8--> | ||
[[File:if_else_example.gif|alt=Greater Than example gif|thumb]] | |||
[[File:greater_than_example.png|alt=Greater Than example code|thumb]] | [[File:greater_than_example.png|alt=Greater Than 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 [[Special:MyLanguage/If Else|if else]] 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. | 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 [[Special:MyLanguage/If Else|if else]] 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. | ||
Latest revision as of 18:10, 16 August 2023
Usage
Determines if the first input is greater than 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 if else 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.