In lists, we are sadly lacking these basic functions. To add insult to injury, the work-arounds for finding them are cumbersome and messy.
We need these blocks.
<maximum of [list v]> <minimum of [list v]> <average of [list v]> <sum of [list v]>Also, these wouldn't hurt.
<mode of [list v]> <median of [list v]> <instances of [thing] in [list v]> <position of [thing] in [list v]>The latter would find the first instance of the thing in the list.
Offline
Wes64 wrote:
In lists, we are sadly lacking these basic functions. To add insult to injury, the work-arounds for finding them are cumbersome and messy.
We need these blocks.<maximum of [list v]> <minimum of [list v]> <average of [list v]> <sum of [list v]>Also, these wouldn't hurt.<mode of [list v]> <median of [list v]> <instances of [thing] in [list v]> <position of [thing] in [list v]>The latter would find the first instance of the thing in the list.
Hey Wes - sorry that you feel that the lack of these features is both an insult and an injury!
However, I think there is some value in letting Scratchers work these problems out for themselves in interesting, creative ways, rather than just providing blocks to do it. For example, max of list could be kept track of with a maxOfList variable. Prior to writing to the list, check to see if the value being written is larger than maxOfList. If not just add it, if so, add it and set maxOfList to the new highest value. Some of the others may be a little more tricky, but since we're thinking of providing ways to make your own blocks (and perhaps, down the road, ways to share them), these could mostly likely get worked out by Scratchers and shared with the community.
Offline
Mokat wrote:
roijac wrote:
mode of list?
mode average, I do believe.
But anyways, I support. I need the maximum of list block for a hangman game.
Mode is the one that is the most common, which is one type of average.
So instead of "average", it should say "mean".
Offline
Mode is the most common item in the list.
So in this list: 1,1,1,1,3,5,6
1 is the mode.
Offline
Lightnin wrote:
Wes64 wrote:
In lists, we are sadly lacking these basic functions. To add insult to injury, the work-arounds for finding them are cumbersome and messy.
We need these blocks.<maximum of [list v]> <minimum of [list v]> <average of [list v]> <sum of [list v]>Also, these wouldn't hurt.<mode of [list v]> <median of [list v]> <instances of [thing] in [list v]> <position of [thing] in [list v]>The latter would find the first instance of the thing in the list.Hey Wes - sorry that you feel that the lack of these features is both an insult and an injury!
However, I think there is some value in letting Scratchers work these problems out for themselves in interesting, creative ways, rather than just providing blocks to do it. For example, max of list could be kept track of with a maxOfList variable. Prior to writing to the list, check to see if the value being written is larger than maxOfList. If not just add it, if so, add it and set maxOfList to the new highest value. Some of the others may be a little more tricky, but since we're thinking of providing ways to make your own blocks (and perhaps, down the road, ways to share them), these could mostly likely get worked out by Scratchers and shared with the community.
I agree, it is important to be able to solve these problems yourself (I have been for a long time), but there's a point it becomes impractical to use those same clumsy scripts over and over again.
Offline
Wes64 wrote:
Lightnin wrote:
Wes64 wrote:
In lists, we are sadly lacking these basic functions. To add insult to injury, the work-arounds for finding them are cumbersome and messy.
We need these blocks.<maximum of [list v]> <minimum of [list v]> <average of [list v]> <sum of [list v]>Also, these wouldn't hurt.<mode of [list v]> <median of [list v]> <instances of [thing] in [list v]> <position of [thing] in [list v]>The latter would find the first instance of the thing in the list.Hey Wes - sorry that you feel that the lack of these features is both an insult and an injury!
However, I think there is some value in letting Scratchers work these problems out for themselves in interesting, creative ways, rather than just providing blocks to do it. For example, max of list could be kept track of with a maxOfList variable. Prior to writing to the list, check to see if the value being written is larger than maxOfList. If not just add it, if so, add it and set maxOfList to the new highest value. Some of the others may be a little more tricky, but since we're thinking of providing ways to make your own blocks (and perhaps, down the road, ways to share them), these could mostly likely get worked out by Scratchers and shared with the community.I agree, it is important to be able to solve these problems yourself (I have been for a long time), but there's a point it becomes impractical to use those same clumsy scripts over and over again.
This is why BYOB is so awesome.
Offline
jvvg wrote:
Wes64 wrote:
Lightnin wrote:
Hey Wes - sorry that you feel that the lack of these features is both an insult and an injury!
However, I think there is some value in letting Scratchers work these problems out for themselves in interesting, creative ways, rather than just providing blocks to do it. For example, max of list could be kept track of with a maxOfList variable. Prior to writing to the list, check to see if the value being written is larger than maxOfList. If not just add it, if so, add it and set maxOfList to the new highest value. Some of the others may be a little more tricky, but since we're thinking of providing ways to make your own blocks (and perhaps, down the road, ways to share them), these could mostly likely get worked out by Scratchers and shared with the community.I agree, it is important to be able to solve these problems yourself (I have been for a long time), but there's a point it becomes impractical to use those same clumsy scripts over and over again.
This is why BYOB is so awesome.
I thought you weren't allowed to share projects you made using BYOB.
Offline
Wes64 wrote:
jvvg wrote:
Wes64 wrote:
I agree, it is important to be able to solve these problems yourself (I have been for a long time), but there's a point it becomes impractical to use those same clumsy scripts over and over again.This is why BYOB is so awesome.
I thought you weren't allowed to share projects you made using BYOB.
You can't share them here, but you can share them on Mod Share.
However, I'm saying you can make a "Mode of list" block on it and save it for future use.
Offline
trinary wrote:
They could be useful, but there are ways to do them already.
Wes64 wrote:
...the work-arounds for finding them are cumbersome and messy.
Offline
kayybee wrote:
If a code is messy, does that mean you can't use it?
That would be wrong to assume. My point is, however, that its messiness makes it rather impractical.
Offline
Wes64 wrote:
kayybee wrote:
If a code is messy, does that mean you can't use it?
That would be wrong to assume. My point is, however, that its messiness makes it rather impractical.
...And also makes the project even more laggy.
Offline
Wes64 wrote:
SciTecCf wrote:
Although, it would make it much easier.
That's the point.
Lightnin wrote:
We’re reluctant to add features that Scratchers can make using the current blocks. It might be a little tricky, but I’m pretty sure you could write a script that would do this. Try asking Scratchers for help making one in the “Help with Scripts” forum.
Offline
Learn the principles of modular programming, and it's not so messy. Just a few broadcasts, some extra variables needed, and you're good. However, median and mode were really annoying when I implemented them into a Scratch project a while back, when I had to make up my own sorting algorithm (I didn't know any sorting methods at the time). Finding the mean of all the numbers in a list is easy, though, and once you have the list sorted, you can easily find the other things you suggested blocks for. Granted, it can be tedious, but it's possible. Besides, people really need something to get their brains running nowadays.
Offline
lalala3 wrote:
Learn the principles of modular programming, and it's not so messy. Just a few broadcasts, some extra variables needed, and you're good. However, median and mode were really annoying when I implemented them into a Scratch project a while back, when I had to make up my own sorting algorithm (I didn't know any sorting methods at the time). Finding the mean of all the numbers in a list is easy, though, and once you have the list sorted, you can easily find the other things you suggested blocks for. Granted, it can be tedious, but it's possible. Besides, people really need something to get their brains running nowadays.
I never said I don't know how to find them. I just wish there was an easier way.
Offline