Discuss Scratch
- Discussion Forums
- » Suggestions
- » Make the 'for each' loop available in the block palette
- UnsungCress
-
28 posts
Make the 'for each' loop available in the block palette
It's already in the editor (if you hack it in) and it's perfectly functional, so why not just add it into the palette without having to go through the extra effort of hacking in the block or backpacking it from someone else?
It would be more convenient and would save a lot of trouble.
It would be more convenient and would save a lot of trouble.
- -Sound_Effect-
-
66 posts
Make the 'for each' loop available in the block palette
It's the same as a Repeat block. It's easier for people of a younger age to understand.
Check out: https://en.scratch-wiki.info/wiki/For_Each_()_in_()_(block) - It's the wiki page for the For Each Loop.
repeat ()
end
Check out: https://en.scratch-wiki.info/wiki/For_Each_()_in_()_(block) - It's the wiki page for the For Each Loop.
- MagicCoder330
-
1000+ posts
Make the 'for each' loop available in the block palette
It's the same as a Repeat block. It's easier for people of a younger age to understand.repeat ()
end
Check out: https://en.scratch-wiki.info/wiki/For_Each_()_in_()_(block) - It's the wiki page for the For Each Loop.
Its sort of like a repeat block, but it is a bit different. A repeat block just repeats a certain amount of times, while the for each () in () block repeats it for every () in (). For instance, if the first number is 5 and the second is 15, it will repeat 3 times. I agree that it isn't the most useful thing in existence, but it has some use.
- UnsungCress
-
28 posts
Make the 'for each' loop available in the block palette
Well yes, but using the for loop would be more convenient for those who do know how it works.
- KingRat_1
-
100+ posts
Make the 'for each' loop available in the block palette
wouldIt's the same as a Repeat block. It's easier for people of a younger age to understand.repeat ()
end
Check out: https://en.scratch-wiki.info/wiki/For_Each_()_in_()_(block) - It's the wiki page for the For Each Loop.
Its sort of like a repeat block, but it is a bit different. A repeat block just repeats a certain amount of times, while the for each () in () block repeats it for every () in (). For instance, if the first number is 5 and the second is 15, it will repeat 3 times. I agree that it isn't the most useful thing in existence, but it has some use.
((15) / (5))not do the same thing?
Last edited by KingRat_1 (Dec. 5, 2023 18:47:00)
- UnsungCress
-
28 posts
Make the 'for each' loop available in the block palette
It's the same as a Repeat block. It's easier for people of a younger age to understand.repeat ()
end
Check out: https://en.scratch-wiki.info/wiki/For_Each_()_in_()_(block) - It's the wiki page for the For Each Loop.
Its sort of like a repeat block, but it is a bit different. A repeat block just repeats a certain amount of times, while the for each () in () block repeats it for every () in (). For instance, if the first number is 5 and the second is 15, it will repeat 3 times. I agree that it isn't the most useful thing in existence, but it has some use.
In my experience, it works like
set [amount v] to [0]
repeat ( amount )
change [amount v] by (1)
end
but in a single loop. For example, if you did this
for each [amount v] in (5){then the sprite would move 1 step, then 2, 3 4 and 5.
move (amount) steps
} :: control
MagicCoder300, you're thinking of
repeat ( () / () )
end
- yadayadayadagoodbye
-
1000+ posts
Make the 'for each' loop available in the block palette
Actually, you would do In my experience, it works likeset [amount v] to [0]
repeat ( amount )
change [amount v] by (1)
end
set [i v] to [1]to imitate a for loop (obviously, make the change i value increase to have it go faster and stuff)
repeat until <[5] < (i)>
change [i v] by (1)
end
- UnsungCress
-
28 posts
Make the 'for each' loop available in the block palette
They both do pretty much the same thing. Actually, you would doset [i v] to [1]to imitate a for loop (obviously, make the change i value increase to have it go faster and stuff)
repeat until <[5] < (i)>
change [i v] by (1)
end
- EDawg2011
-
1000+ posts
Make the 'for each' loop available in the block palette
Children probably won't understand this block, so it might get renamed to something like “(variable name) count to (input)” 
(Someone please tell me how to make a custom C block. (Edit: in a forum post.))
Another edit: I found it out.

(Someone please tell me how to make a custom C block. (Edit: in a forum post.))
Another edit: I found it out.
[x v] count to (){3rd edit: Fixed block.
} :: control
Last edited by EDawg2011 (Dec. 5, 2023 22:09:18)
- IndexErrorException
-
500+ posts
Make the 'for each' loop available in the block palette
Support, don't rename. I already use this block in most of my programs, it takes a couple steps out.
- unmissable
-
1000+ posts
Make the 'for each' loop available in the block palette
Support because it can actually be useful
And it's not like they're going to need to code it since it already exists
edit:typo
And it's not like they're going to need to code it since it already exists
edit:typo
Last edited by unmissable (Dec. 5, 2023 23:31:52)
- EDawg2011
-
1000+ posts
Make the 'for each' loop available in the block palette
It would need to be renamed because its name is very vague. wdym by “for each (foo v) in (n)” Does it divide “n” by “foo” and repeat it that many times, or does it do something for each time the “n” is contained in “foo”? It's confusing, and I didn't even know how it worked. Support, don't rename. I already use this block in most of my programs, it takes a couple steps out.

- Scratchedbyyou
-
100+ posts
Make the 'for each' loop available in the block palette
Support, I use the workaround a lot and it's getting annoying, I also don't want to get my project marked as nfe for using the removed block in a project either.
- ajskateboarder
-
1000+ posts
Make the 'for each' loop available in the block palette
This is how almost every language has named for loopsIt would need to be renamed because its name is very vague. wdym by “for each (foo v) in (n)” Does it divide “n” by “foo” and repeat it that many times, or does it do something for each time the “n” is contained in “foo”? It's confusing, and I didn't even know how it worked. Support, don't rename. I already use this block in most of my programs, it takes a couple steps out.

Also, this is a very related suggestion: https://scratch-mit-edu.ezproxyberklee.flo.org/discuss/topic/204415/
- No_Normal
-
100+ posts
Make the 'for each' loop available in the block palette
No, the repeat block has its own use, I wish there was a for each in i, because it is really helpful and some of my projects are slow because the workaround adds a bunch of blocks. It's the same as a Repeat block. It's easier for people of a younger age to understand.repeat ()
end
Check out: https://en.scratch-wiki.info/wiki/For_Each_()_in_()_(block) - It's the wiki page for the For Each Loop.
- RediblesQW_Doors
-
38 posts
Make the 'for each' loop available in the block palette
for each [var v] in (…){
}::control
Last edited by RediblesQW_Doors (Dec. 17, 2023 13:27:59)
- ichan2
-
2 posts
Make the 'for each' loop available in the block palette
Sorry i posted something but it was wrong

Last edited by ichan2 (April 11, 2024 10:47:57)
- banana439monkey
-
1000+ posts
Make the 'for each' loop available in the block palette
and maybe even a
Banana
range between () and () :: list reporterblock?
Banana
- Discussion Forums
- » Suggestions
-
» Make the 'for each' loop available in the block palette