With % Chance: Difference between revisions

From StarLogo Nova Wiki
(updates from Blockument)
(Marked this version for translation)
 
Line 2: Line 2:
<translate>
<translate>


<!--T:2-->
<section begin="image"/>[[File:with_chance.png|alt=The With % Chance Block|thumb]]<section end="image"/><p id=tooltip>Changes the probability that the code on the hook will be executed.</p>
<section begin="image"/>[[File:with_chance.png|alt=The With % Chance Block|thumb]]<section end="image"/><p id=tooltip>Changes the probability that the code on the hook will be executed.</p>


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


<!--T:4-->
Inputs in this block:
Inputs in this block:
#a number
#a number


==Example==
==Example== <!--T:5-->


<!--T:6-->
[[File:with_chance_example.gif|alt=With % Chance example gif|thumb]]
[[File:with_chance_example.gif|alt=With % Chance example gif|thumb]]
[[File:with_chance_example.png|alt=With % Chance example code|thumb]]
[[File:with_chance_example.png|alt=With % Chance example code|thumb]]


<!--T:7-->
The model above shows a contagious disease. On contact with a ‘sneeze’ agent, healthy agents have a 40% of contracting the disease (becoming red).
The model above shows a contagious disease. On contact with a ‘sneeze’ agent, healthy agents have a 40% of contracting the disease (becoming red).



Latest revision as of 14:56, 14 August 2023

Other languages:
The With % Chance Block

Changes the probability that the code on the hook will be executed.

Syntax

Inputs in this block:

  1. a number

Example

With % Chance example gif
With % Chance example code

The model above shows a contagious disease. On contact with a ‘sneeze’ agent, healthy agents have a 40% of contracting the disease (becoming red).