While: Difference between revisions
(updates from Blockument) |
(Marked this version for translation) |
||
Line 5: | Line 5: | ||
<section begin="image"/>[[File:while.png|alt=The While Block|thumb]]<section end="image"/><p id="tooltip">Tests to see if the condition is true. If so, then executes the commands attached to the hook. Repeats these commands continually while the condition remains true.</p> | <section begin="image"/>[[File:while.png|alt=The While Block|thumb]]<section end="image"/><p id="tooltip">Tests to see if the condition is true. If so, then executes the commands attached to the hook. Repeats these commands continually while the condition remains true.</p> | ||
==Syntax== | ==Syntax== <!--T:3--> | ||
<!--T:4--> | |||
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) | ||
==Example== | ==Example== <!--T:5--> | ||
<!--T:6--> | |||
[[File:while_example.gif|alt=While example gif|thumb]] | [[File:while_example.gif|alt=While example gif|thumb]] | ||
[[File:while_example.png|alt=While example code|thumb]] | [[File:while_example.png|alt=While example code|thumb]] | ||
<!--T:7--> | |||
Above is a model of growing plants. These plants need rain to fall on them in order to get larger. The while loop controls the weather, dictating whether or not there is a thunderstorm. | Above is a model of growing plants. These plants need rain to fall on them in order to get larger. The while loop controls the weather, dictating whether or not there is a thunderstorm. | ||
Revision as of 14:52, 14 August 2023
Tests to see if the condition is true. If so, then executes the commands attached to the hook. Repeats these commands continually while the condition remains true.
Syntax
Inputs in this block:
Example
Above is a model of growing plants. These plants need rain to fall on them in order to get larger. The while loop controls the weather, dictating whether or not there is a thunderstorm.