#Arrays Guide
1 messages · Page 1 of 1 (latest)
combine attribute block with array to access advanced functions
Nth item retrieves the value of an item, and so you can manipulate items with set(array)extract the {input} item
Length just reports how many numbers value contains
Search becomes 1 if it finds the exact given it's value. if not, becomes 0.
if you want to ensure that a value doesn't go lower than a certain threshold, you can use the "MAX" function.
the "MIN" function prevents a value from going higher than the specified threshold.
and you can also combine them
Contains is a boolean block that checks whether a list contains a given value
Sum function takes all the values within the array and adds them together
(array)sum = 14 (2 + 4 + 8)
The Average function divides each value by the total amount of items. example: {3, 6, 9, 18} command array.average will output 9, since values are divided by 4. ((3 / slots amount(4) + 6 / slots amount(4) + 9 / slots amount(4) + 18 / slots amount(4)) = 9
Join to string just adds symbol between items, nothing really special about it.
W
The search, length, max and min tutorials are wrong
Pls explain it then
Nice
Note: The maximum and minimum have been switched here. It should be the other way round.
Length is the number of values in an array.
Search tells you the location (N) of a value. If the number is not in the array, then it will output zero. So in this case, if you had searched 4926 the output would have been 2.
Or in simpler terms, it divides the sum of values by the number of values. Or in even simpler terms, it finds the average value.
^^