While/en: Difference between revisions

From StarLogo Nova Wiki
(Updating to match new version of source page)
(Updating to match new version of source page)
 
Line 1: Line 1:
<languages/>
<languages/>


<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==
 
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)
 
==Example==
 
[[File:while_example.gif|alt=While example gif|thumb]]
[[File:while_example.png|alt=While example code|thumb]]
 
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.


[[Category:Logic]]
[[Category:Logic]]
[[Category:Code Block]]
[[Category:Code Block]]

Latest revision as of 17:25, 14 August 2023

Other languages:
The While Block

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:

  1. a comparative statement block (= statements, > statements, not statement, and/or statements)

Example

While example code

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.