Yield: Difference between revisions
(Marked this version for translation) |
(duplicate file already uploaded) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
<!--T:2--> | <!--T:2--> | ||
<p id="tooltip">Works as a pause in the current stack of code for 1 tick.</p> | <section begin="image"/>[[File:yield.png|alt=The Yield Block|thumb]]<section end="image"/><p id="tooltip">Works as a pause in the current stack of code for 1 tick.</p> | ||
==Example== <!--T:3--> | |||
<!--T:4--> | |||
[[File:repeat_times_example.gif|alt=Yield example gif|thumb]] | |||
[[File:yield_example.png|alt=Yield example code|thumb]] | |||
<!--T:5--> | |||
Yield can be used to complete tasks sequentially. In this example, when ‘celebrate’ is pushed we see that after each yield block a new forward step is taken. This shows that the yield block pauses the current set of instructions for one tick of the StarLogo Nova [[Special:MyLanguage/Clock|clock]]. | |||
<!--T:1--> | <!--T:1--> |
Latest revision as of 18:07, 16 August 2023
Works as a pause in the current stack of code for 1 tick.
Example
Yield can be used to complete tasks sequentially. In this example, when ‘celebrate’ is pushed we see that after each yield block a new forward step is taken. This shows that the yield block pauses the current set of instructions for one tick of the StarLogo Nova clock.