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

#1 2009-07-11 14:28:36

The-Whiz
Scratcher
Registered: 2007-07-09
Posts: 1000+

Another block

I just had an idea for a block:

([LIST] contains how many of [__]?)

Reporter block.

Offline

 

#2 2009-07-11 23:42:21

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Another block

Hmm, what could that be used for?

Offline

 

#3 2009-07-12 08:15:55

The-Whiz
Scratcher
Registered: 2007-07-09
Posts: 1000+

Re: Another block

The <[LIST] contains [__]> Will only say true/false if it has one or more. The new block would say specifically how many.

Offline

 

#4 2009-07-13 09:43:55

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Another block

But what would it be used for?

Offline

 

#5 2009-07-13 13:17:40

The-Whiz
Scratcher
Registered: 2007-07-09
Posts: 1000+

Re: Another block

Like if you have a list of numbers and you want to see how many times "1" is there, you would use it.

Offline

 

#6 2009-07-13 13:26:05

ihaveamac
Scratcher
Registered: 2007-09-22
Posts: 1000+

Re: Another block

I get it...

Lets say I have a list of 5 'ICE' and 3 'lol', if you used (LIST contains how many of [ICE]) it would report 5.

But that can be used differently.

set %num to (0)
set %read to (1)
repeat (length of !list!)
if < (item (read) of !list!) = [ICE]>
change %num by (1)
<end if>
change %read by (1)
<end repeat>

num would be 5.


~ihaveamac - visit ihaveamac.net

Offline

 

#7 2009-07-13 13:29:11

The-Whiz
Scratcher
Registered: 2007-07-09
Posts: 1000+

Re: Another block

Yeah, I've used that before, but wouldn't a block be easier?

Offline

 

#8 2009-07-20 14:16:14

TheoMarr
Scratcher
Registered: 2009-04-13
Posts: 100+

Re: Another block

You should include these blocks:
[Show list []]
[Hide list []]
[Move [] of [] to [] of []]
<Color [] of [] is touching []?>

Offline

 

#9 2009-07-20 19:55:02

The-Whiz
Scratcher
Registered: 2007-07-09
Posts: 1000+

Re: Another block

[Move [] of [] to [] of []] can be done with

Code:

[insert (item () of ()) at () of []]
[delete () of []]

Offline

 

#10 2009-07-21 01:36:28

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Another block

I wouldn't be using the block but it would be nice.

By the way...

TheoMarr wrote:

You should include these blocks:
[Show list []]
[Hide list []]
[Move [] of [] to [] of []]
<Color [] of [] is touching []?>

You could recommend these in some topics that ask for different blocks that people want in Scratch 1.5.

Last edited by Jonathanpb (2009-07-21 01:37:22)


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

Board footer