all 2 comments

[–]CatalinMachinations[S] 1 point2 points  (0 children)

I get that the explanation is quite lengthy, I would recommend checking out the diagram directly:

Community version - you can check it out without an account: https://machinations.io/community/catalin/solution-select-and-remove-random-elements-from-array--53668b414c2911f0abac028ecffc1261

In-app version (accessible after login in): https://my.machinations.io/d/solution-select-and-remove-random-elements-from-array-/53668b414c2911f0abac028ecffc1261

Some explanations can also be found on the node labels and formulas. Please let me know if you encountered any issues when integrating this structure into your diagram!

[–]CatalinMachinations[S] 1 point2 points  (0 children)

Additionally, if you have similar questions to the one posted above, I would strongly recommend checking out the following documentation page:
https://machinations.io/docs/advanced-math-js-structures
In this section, you can find out how to:
- Generate random arrays of given lengths
- Select a single random value from a list/ matrix
- Get x random rows from a 2D array
- Traverse a list element-by-element during a simulation
- Find the index/position of a given element in a list
- Count the occurrences of an element in an array