Or: Difference between revisions
(updates from Blockument) |
(Marked this version for translation) |
||
Line 2: | Line 2: | ||
<translate> | <translate> | ||
<!--T:3--> | |||
<section begin="image"/>[[File:or.png|alt=The Or Block|thumb]]<section end="image"/> | <section begin="image"/>[[File:or.png|alt=The Or Block|thumb]]<section end="image"/> | ||
==Usage== | ==Usage== <!--T:4--> | ||
<!--T:2--> | <!--T:2--> | ||
<p id="tooltip">Determines if either the first or second input are true. If at least one is true then returns true; else returns false.</p> | <p id="tooltip">Determines if either the first or second input are true. If at least one is true then returns true; else returns false.</p> | ||
==Syntax== | ==Syntax== <!--T:5--> | ||
<!--T:6--> | |||
Inputs in this block: | Inputs in this block: | ||
#a comparative statement block ([[Special:MyLanguage/Equals|=]] statements, [[Special:MyLanguage/Greater Than|>]] statements, [[Special:MyLanguage/Not|not]] statement, [[Special:MyLanguage/And|and]]/[[Special:MyLanguage/Or|or]] statements) | #a comparative statement block ([[Special:MyLanguage/Equals|=]] statements, [[Special:MyLanguage/Greater Than|>]] statements, [[Special:MyLanguage/Not|not]] statement, [[Special:MyLanguage/And|and]]/[[Special:MyLanguage/Or|or]] statements) | ||
#another comparative statement block | #another comparative statement block | ||
==Example== | ==Example== <!--T:7--> | ||
<!--T:8--> | |||
[[File:or_example.gif|alt=Or example gif|thumb]] | [[File:or_example.gif|alt=Or example gif|thumb]] | ||
[[File:or_example.png|alt=Or example code|thumb]] | [[File:or_example.png|alt=Or example code|thumb]] | ||
<!--T:9--> | |||
In this epidemic model, the trait ‘Had disease’ was created to keep track of all of the agents who had contracted the disease at some point. These agents were tracked on the line graph in purple. The ‘or’ block was used in the if statement so that agents with the color red or the color blue could be specified. | In this epidemic model, the trait ‘Had disease’ was created to keep track of all of the agents who had contracted the disease at some point. These agents were tracked on the line graph in purple. The ‘or’ block was used in the if statement so that agents with the color red or the color blue could be specified. | ||
<!--T:10--> | |||
<strong>Note:</strong> Because the ‘or’ block has a round peg and the ‘count within’ block used for the line graph only takes inputs with a square peg, it is impossible to simply count agents with ‘color red or blue’ for the line graph. This is why the trait ‘Had disease?’ was created. Now the line graph ‘contracted disease’ series [[Special:MyLanguage/Count Within Steps With =|counts agents within 200 steps with ‘Had disease?’ = 1]]. | <strong>Note:</strong> Because the ‘or’ block has a round peg and the ‘count within’ block used for the line graph only takes inputs with a square peg, it is impossible to simply count agents with ‘color red or blue’ for the line graph. This is why the trait ‘Had disease?’ was created. Now the line graph ‘contracted disease’ series [[Special:MyLanguage/Count Within Steps With =|counts agents within 200 steps with ‘Had disease?’ = 1]]. | ||
Latest revision as of 15:34, 14 August 2023
Usage
Determines if either the first or second input are true. If at least one is true then returns true; else returns false.
Syntax
Inputs in this block:
- a comparative statement block (= statements, > statements, not statement, and/or statements)
- another comparative statement block
Example
In this epidemic model, the trait ‘Had disease’ was created to keep track of all of the agents who had contracted the disease at some point. These agents were tracked on the line graph in purple. The ‘or’ block was used in the if statement so that agents with the color red or the color blue could be specified.
Note: Because the ‘or’ block has a round peg and the ‘count within’ block used for the line graph only takes inputs with a square peg, it is impossible to simply count agents with ‘color red or blue’ for the line graph. This is why the trait ‘Had disease?’ was created. Now the line graph ‘contracted disease’ series counts agents within 200 steps with ‘Had disease?’ = 1.