Project - For loop …with effort!
This is the example for the block for tries and decimal tests.
Instructions
How to use the block
- You need to declare the variable to the object containing the following keys to set the properties in the ring block slot.
- “indices” to declare the indices.
- “controls” to control the indices; must contain the object variable to control.
-
Setter: Sets the initial indices.
How to use
Assume that there is an object stored in the variable
control.
The the 1st index ofcontrolindex is set to 0.
You can do the following to change it to 3:
replace item (1 v) of (item (indices v) of (control)) with [3] -
Comparing block: Compares the expression. If the comparison becomes true, do the command wrapped by the block.
How to use
You can use this block to compare if the 1st index of the
controlobject is less than 10.
<(item (1 v) of (item (indices v) of (control))) \< [10] @<:> > -
Incrementing block: Increments the indices.
How to use
You can use this block to increment the 1st index of the
controlobject by 1.
change by (1) to item (1) of (item (indices v) of (control)) :: lists[1][2]
-
- Use the upvars to represent the indices. (The first upvar belongs in the first index, The second upvar belong in the second index, and so on…)
Additional context
Useful for for loops with certain steps!
Final greetings
That’s all of it.
I am glad to see you in this forum to use the control block.
Make sure you export the for with effort: ({} @>) {
} :: control block,
and rename the exported file to for with effort block![2:1]
See you in the next post! Bye~