This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-06-15 09:14:30

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Maximum, minimum functions

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.


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#2 2012-06-15 09:25:28

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: Maximum, minimum functions

mode of list?

Offline

 

#3 2012-06-15 09:38:02

Lightnin
Scratch Team
Registered: 2008-11-03
Posts: 1000+

Re: Maximum, minimum functions

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.


Help Scratchers make the leap to 2.0!
http://img818.imageshack.us/img818/6844/transitionteam.jpg

Offline

 

#4 2012-06-15 09:38:40

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Maximum, minimum functions

Support, and I think some of these are in the block library.


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#5 2012-06-15 09:56:26

Mokat
Scratcher
Registered: 2011-12-08
Posts: 1000+

Re: Maximum, minimum functions

roijac wrote:

mode of list?

mode average, I do believe.  smile
But anyways, I support. I need the maximum of list block for a hangman game.


http://www.eggcave.com/egg/977371.pnghttp://www.eggcave.com/egg/977376.pnghttp://www.eggcave.com/egg/1005291.pnghttp://www.eggcave.com/egg/996745.png

Offline

 

#6 2012-06-15 09:59:31

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Maximum, minimum functions

Mokat wrote:

roijac wrote:

mode of list?

mode average, I do believe.  smile
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".


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#7 2012-06-15 18:11:04

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Maximum, minimum functions

Mode is the most common item in the list.

So in this list: 1,1,1,1,3,5,6

1 is the mode.


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#8 2012-06-15 18:15:39

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Maximum, minimum functions

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.


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#9 2012-06-15 18:31:18

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Maximum, minimum functions

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.  tongue


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#10 2012-06-15 18:36:23

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Maximum, minimum functions

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.  tongue

I thought you weren't allowed to share projects you made using BYOB.


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#11 2012-06-15 18:43:16

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Re: Maximum, minimum functions

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.  tongue

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.


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 

#12 2012-06-16 05:31:48

trinary
Scratcher
Registered: 2012-01-29
Posts: 1000+

Re: Maximum, minimum functions

They could be useful, but there are ways to do them already.


http://trinary.tk/images/signature_.php

Offline

 

#13 2012-06-16 05:33:56

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Maximum, minimum functions

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.


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#14 2012-06-18 03:45:09

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Maximum, minimum functions

If a code is messy, does that mean you can't use it?

Offline

 

#15 2012-06-18 04:07:20

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Maximum, minimum functions

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.


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#16 2012-06-18 04:41:54

SciTecCf
Scratcher
Registered: 2011-11-23
Posts: 1000+

Re: Maximum, minimum functions

These are all already possible. I used a solution to (position of [] in [list v]) in my Migilang project. Although, it would make it much easier.


http://bit.ly/LCZEJRhttp://bit.ly/LSONcOhttp://bit.ly/LF3vIc
http://trinary.site40.net/images/scratchrank.php?username=SciTecCf&amp;display=small

Offline

 

#17 2012-06-18 05:29:12

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Maximum, minimum functions

SciTecCf wrote:

Although, it would make it much easier.

That's the point.


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#18 2012-06-18 05:38:10

jontmy00
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: Maximum, minimum functions

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.


FOR ALL THE NEWS ON UPDATES FOR SIMPLISTICRAFT, CLICK HERE.

Offline

 

#19 2012-06-18 06:10:40

SciTecCf
Scratcher
Registered: 2011-11-23
Posts: 1000+

Re: Maximum, minimum functions

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.

hmm


http://bit.ly/LCZEJRhttp://bit.ly/LSONcOhttp://bit.ly/LF3vIc
http://trinary.site40.net/images/scratchrank.php?username=SciTecCf&amp;display=small

Offline

 

#20 2012-06-19 22:18:49

lalala3
Scratcher
Registered: 2008-10-03
Posts: 100+

Re: Maximum, minimum functions

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.


http://img515.imageshack.us/img515/9374/signature2nt.png

Offline

 

#21 2012-06-20 05:04:04

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Maximum, minimum functions

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.


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

Board footer