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.
Some rules that aren't mentioned or clarified in the Community Guidelines or the Terms of Use:
- 'The Browser Extension/Userscript Policy' (why you can't say the name of a certain browser extension that lots of Scratchers use)
- '“Art theft” and our remixing policy' (why people are allowed to recolour your OCs with credit)
- 'Shops, Points, and Pretend Currency Systems' (why you technically aren't allowed to use follows as a prize in contests)
- '“Music Sharing” Projects' (why that Imagine Dragons music project from 2021 was taken down)
- “Face Reveal” Projects (why you're not allowed to share your face on Scratch, even if someone wants to draw a portrait of you)
- “Five Nights at Freddy's” (why that fangame you spent a month working on, complete with jumpscares and a traumatising backstory, is not allowed)
- k0d3rrr
- Scratcher
1000+ posts
New Lists Block
Butter's best burnt beside bacon, because burnt banana bacon burgers buy better burnt.
Bump.
Bump.
Some rules that aren't mentioned or clarified in the Community Guidelines or the Terms of Use:
- 'The Browser Extension/Userscript Policy' (why you can't say the name of a certain browser extension that lots of Scratchers use)
- '“Art theft” and our remixing policy' (why people are allowed to recolour your OCs with credit)
- 'Shops, Points, and Pretend Currency Systems' (why you technically aren't allowed to use follows as a prize in contests)
- '“Music Sharing” Projects' (why that Imagine Dragons music project from 2021 was taken down)
- “Face Reveal” Projects (why you're not allowed to share your face on Scratch, even if someone wants to draw a portrait of you)
- “Five Nights at Freddy's” (why that fangame you spent a month working on, complete with jumpscares and a traumatising backstory, is not allowed)
- 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