If: Difference between revisions

From StarLogo Nova Wiki
No edit summary
(add tooltip text)
Line 6: Line 6:


<!--T:15-->
<!--T:15-->
<section begin=image/>[[File:If.png|alt=The if block|thumb]]<section end=image/>
<section begin=image/>[[File:If.png|alt=The if block|thumb]]<section end=image/><p id="tooltip">Test for something. If true, then the agent follows the commands attached to the hook.</p>
 
<section begin=name/>'''<code>if [_]</code>'''<section end=name/> is a [[code block]] part of the [[Logic]] drawer.
<section begin=name/>'''<code>if [_]</code>'''<section end=name/> is a [[code block]] part of the [[Logic]] drawer.


Line 12: Line 13:


<!--T:17-->
<!--T:17-->
<p id="tooltip"><code>if [_]</code> takes in comparative statements from the [[Logic]] drawer to test for a condition. The [[agent]] will only follow commands attached to the hook if the statement is true.</p>
<code>if [_]</code> takes in comparative statements from the [[Logic]] drawer to test for a condition. The [[agent]] will only follow commands attached to the hook if the statement is true.


==Syntax== <!--T:18-->
==Syntax== <!--T:18-->

Revision as of 15:25, 8 August 2023

Other languages:
The if block

Test for something. If true, then the agent follows the commands attached to the hook.

if [_] is a code block part of the Logic drawer.

Usage

if [_] takes in comparative statements from the Logic drawer to test for a condition. The agent will only follow commands attached to the hook if the statement is true.

Syntax

The If Block

Inputs in this block:

  1. a comparative statement block (+ statements, > statements, Not statement, and/or statements)

Nuances

Related Blocks