Hey I know it's been a while, and I don't know if I'm just being dumb or this is actually a problem, but I recieved this issue after making an average block:
Obviously, if you understand math, this should output 2. Any ideas?
Ah, a simple fix solved my problem. Just had to store the input's length and then use it at the end of the script.
Solved it myself, no other solution needed!
To calculate the average, you can just do
The issue you were having has to do with this
Short answer: You didn't copy the list to the variable, you gave the same list another name. [The pictures below are a lie. See below the divider -------- for the full story.]
Here's what it looks like:
[untitled%20script%20pic]
[Stage]
The list is made of pairs, each of which points to one list item (left half) and to another pair (right half). The right half of the last pair is a special empty-list object.
[untitled%20script%20pic%20(2)]
The variable FOO points to the list, and the S…
but to fix it, just set "list 2" to
qw23
June 3, 2023, 4:50pm
4
Just for a bit of fun, below is a (very Snappy! ) recursive version:
The delete
block deleted items from the list, so the length decreased.
Oh god... I have a feeling this will break... I'll try it anyways.
qw23
June 20, 2023, 7:27am
7
… and you could even use it with the recursive version of LENGTH OF (data) from Fixing Unordered combinations custom block - #45 by kinestheticlearning (while fixing the deliberate error within the base case, of course) Even though this would not be very inefficient.
system
Closed
July 20, 2023, 7:27am
8
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.