Discuss Scratch
- Discussion Forums
- » Suggestions
- » New Lists Block
- Pandan_the_coder
- Scratcher
100+ posts
New Lists Block
This is what it looks like:
It returns the number of times an item appears. If the list’s items are:
thing
another thing
thing
The block would return 2 if “thing” was the option.
(# of times [thing] appears in [list v] :: list)
It returns the number of times an item appears. If the list’s items are:
thing
another thing
thing
The block would return 2 if “thing” was the option.
Join my collab series! —> https://scratch.mit.edu/discuss/topic/726760/
- DinoMaster20
- Scratcher
1000+ posts
New Lists Block
How exactly would this be used to help make projects better?
Last edited by kaj (Tomorrow, 00:00:00)
~ ᴅᴍ20 ~
This is my forum signature! It shows up under every post I make! Here is more info!
ERRØR; THE NEXT BIG THING “Resolved” Button for QaS
/\ Male /\ Forumer /\ TokTik /\ Chatsnap /\
/\ Scratch Wiki /\ Community Guidelines /\ Scratch Team /\ Postpercent /\ Ocular
Currently most active on the forums! I don't make projects, I might come out with one in 100 years.
thanks to rl1123 for gif, and hosting it bc my braindead self couldn't do it
I have eaten the rest of DinoMaster20's siggy! Yum! Find out how to stop evil kumquats like myself here: Evil Kumquat Guards
This is my forum signature! It shows up under every post I make! Here is more info!
ERRØR; THE NEXT BIG THING “Resolved” Button for QaS
/\ Male /\ Forumer /\ TokTik /\ Chatsnap /\
/\ Scratch Wiki /\ Community Guidelines /\ Scratch Team /\ Postpercent /\ Ocular
Currently most active on the forums! I don't make projects, I might come out with one in 100 years.
thanks to rl1123 for gif, and hosting it bc my braindead self couldn't do it
I have eaten the rest of DinoMaster20's siggy! Yum! Find out how to stop evil kumquats like myself here: Evil Kumquat Guards
- k0d3rrr
- Scratcher
1000+ posts
New Lists Block
So is this what you mean?
Example:
So, let's say you bought some cake for a party. You store that in the list.
Next, you bring drinks over to the party. You store that in the list as well.
However, someone else has also brought a cake over, so you have to add that to the list as well.
After that, eighteen people have come to bring cake (you can't count them all at once, but they're in the list.)
Because you've forgotten how many cakes are on the list now, this block detects how many cakes there are now.
Example:
So, let's say you bought some cake for a party. You store that in the list.
add [Cake] to [Party Items v]
Next, you bring drinks over to the party. You store that in the list as well.
add [Drinks] to [Party Items v]
However, someone else has also brought a cake over, so you have to add that to the list as well.
add [Cake] to [Party Items v]
After that, eighteen people have come to bring cake (you can't count them all at once, but they're in the list.)
repeat [18]
add [Cake] to [Party Items v]
end
Because you've forgotten how many cakes are on the list now, this block detects how many cakes there are now.
# of times [Cake] appears in [Party Items v]:: list reporterThis returns back as 20, so now you know how many cakes there are. (Also, 20 cakes are too much!) Support as shown in this example.
k0d3rrr
3 forum tips for experienced forumers (in no particular order):
- If you are reporting a new forumer's topic to be closed, or moved to another forum, don't mention it, because then, the topic creator will think they will receive either an alert or a ban.
- New forumers won't immediately know the rules or terminology of the forums. I have seen this happen hundreds of times (exaggeratedly), especially when experienced forumers (I won't name any) tell new forumers that they are "necroposting", which is when someone posts on an old and resolved topic (especially in the Questions about Scratch forum), causing said topic to be moved to the front page of that forum.
- Using Scratchblocks as a writing style is not blockspam, unless it is irrelevant to the discussion. For example, this
is not blockspam, but these How do I make a smooth gliding animation?when green flag clicked
repeat until <(my question) = [answered]>
ask [How do I make a smooth gliding animation?] and wait
end
say [Thank you!]when green flag clicked
move (58) steps
play sound [Stock Laughter Sound Effect HD - 1 Hour v]
forever
play sound [Stock Screaming Sound Effect HD - 1 Hour v]
switch backdrop to [internet v]
say [i broke the internet] for (2) secs
turn cw (15) degrees
go to [nearby restaurant v]
next costume
end
are blockspam, and must be reported.when green flag clicked
repeat until <(out of dorito's) = [true]>
broadcast [eat dorito chip v]
end
say [IM OUT OF DORITO'S!!!!!!!!! :(]
play sound [Scream2 v] until done
forever
turn cw (120) degrees
play sound [Scream2 v]
play sound [we have no dorito's sorry v]
end
- k0d3rrr
- Scratcher
1000+ posts
New Lists Block
Butter's best burnt beside bacon, because burnt banana bacon burgers buy better burnt.
Bump.
Bump.
k0d3rrr
3 forum tips for experienced forumers (in no particular order):
- If you are reporting a new forumer's topic to be closed, or moved to another forum, don't mention it, because then, the topic creator will think they will receive either an alert or a ban.
- New forumers won't immediately know the rules or terminology of the forums. I have seen this happen hundreds of times (exaggeratedly), especially when experienced forumers (I won't name any) tell new forumers that they are "necroposting", which is when someone posts on an old and resolved topic (especially in the Questions about Scratch forum), causing said topic to be moved to the front page of that forum.
- Using Scratchblocks as a writing style is not blockspam, unless it is irrelevant to the discussion. For example, this
is not blockspam, but these How do I make a smooth gliding animation?when green flag clicked
repeat until <(my question) = [answered]>
ask [How do I make a smooth gliding animation?] and wait
end
say [Thank you!]when green flag clicked
move (58) steps
play sound [Stock Laughter Sound Effect HD - 1 Hour v]
forever
play sound [Stock Screaming Sound Effect HD - 1 Hour v]
switch backdrop to [internet v]
say [i broke the internet] for (2) secs
turn cw (15) degrees
go to [nearby restaurant v]
next costume
end
are blockspam, and must be reported.when green flag clicked
repeat until <(out of dorito's) = [true]>
broadcast [eat dorito chip v]
end
say [IM OUT OF DORITO'S!!!!!!!!! :(]
play sound [Scream2 v] until done
forever
turn cw (120) degrees
play sound [Scream2 v]
play sound [we have no dorito's sorry v]
end
- historical_supa
- Scratcher
1000+ posts
New Lists Block
This would very useful, it's better than using repeats and variables and ifs and stuff.
i love life
- 10goto10
- Scratcher
500+ posts
New Lists Block
The problem with adding new reporters to Scratch is that they should be “wide”. They should be general in the kinds of things that you could do with them.
So, I went to Snap to see what reporters they have that were ‘wide’. I think I found something and it works. if you give it a try then the bear will say the number of cakes in the list.
The above program can be found
here.
Now the following is my attempt at a Scatch script that does the same. It works but it’s lengthy. Much of this exhausting Scratch code can be avoided if Scratch had more blocks. But would you say my Snap program above satisfied the low floor requirement of Scratch?
So, I went to Snap to see what reporters they have that were ‘wide’. I think I found something and it works. if you give it a try then the bear will say the number of cakes in the list.
The above program can be found
here.
Now the following is my attempt at a Scatch script that does the same. It works but it’s lengthy. Much of this exhausting Scratch code can be avoided if Scratch had more blocks. But would you say my Snap program above satisfied the low floor requirement of Scratch?
delete (All v) of [Food Items v]
repeat (10)
if <(pick random (1) to (2)) = [2]> then
set [Food Type v] to [Cake]
else
set [Food Type v] to [Cake]
end
add (Food Type) to [Food Items v]
End
say (join (join [There are ] (length of [Food Items v] :: list)) [ Food items])
set [Count of Cakes v] to [0]
set [Food Index v] to [0]
repeat (length of [Food items v] :: list)
if <(item (Food Index) of [Food items v] :: list) = [Cake]> then
change [Count of Cakes v] by (1)
end
change [Food Index v] by (1)
end
say (join [There are ] (join (Count of Cakes) [ Cakes]))
Do you have an Animate a Name project that you'd like to have added to a studio? Please leave a comment in this studio.
- Kiska-7275
- Scratcher
1000+ posts
New Lists Block
Bump, and support. Most New Scratchers do not know the aforementioned workaround.
Всем здоровья и удачи :: pen cap
- 10goto10
- Scratcher
500+ posts
New Lists Block
My “keep items” block in the post above wasn’t a workaround.
I was asking if people thought original suggestion was a “wide” enough block. Would a “count” reporter be used in a lot of projects? Is making an exact match too narrow or should some type of comparison be used instead? If so, then maybe the reporter should return a list of either values or indexes because then you’d have something that could be used by any code that followed.
However, the code I wrote in the second part is just basic Scratch code. It’s just programming.
I was asking if people thought original suggestion was a “wide” enough block. Would a “count” reporter be used in a lot of projects? Is making an exact match too narrow or should some type of comparison be used instead? If so, then maybe the reporter should return a list of either values or indexes because then you’d have something that could be used by any code that followed.
However, the code I wrote in the second part is just basic Scratch code. It’s just programming.
Do you have an Animate a Name project that you'd like to have added to a studio? Please leave a comment in this studio.
- EDGE_X
- Scratcher
100+ posts
New Lists Block
I actually can find a few things that can make this block useful, like a quiz question or a random number generator. I think this block would be useful for keeping the same people off of a cloud leaderboard if their username is already on it, so I support.
Perfect Cell you are perfect! Be perfect, stay perfect, have a perfect life!Follow me here!
Helper of Scratch Forums. Most Active in Suggestions, Help with Scripts and Bugs And Glitches
when green flag clicked::control
wait until <<perfect? ::#6362e1> = [true]::operators>::events
be perfect! ::#782fea cap
My Kumquat Protectors{
-.-::#f00
'.'::#f90
o.o::#fc0
._.::#0f0
^.^::#00f
*~*::#d0f}::#999 hat
they protect my signature from evil kumquats!::#e4f166
good to have them!::#a277b1
oh hey you found the secret message in my signature.
do not click this
Well scratch changed the way that youtube videos function directly from Scratch so this trick doesn't work anymore.
- Discussion Forums
- » Suggestions
- » New Lists Block