Discuss Scratch

IndexErrorException
Scratcher
500+ posts

letters () to () of () block

Support this block is called substring in most programming languages and JavaScript has it built in already, which if this was implemented it would be way faster than if you made your own workaround custom block. I needed this in the past and it's a shame it's not already in Scratch
Bobmr2024
Scratcher
100+ posts

letters () to () of () block

Paddle2See wrote:

lalala3 wrote:

TheHockeyist wrote:

Indifferent.
Then don't post.
I get a bit annoyed when I see really short responses to suggestions. Simply saying you support or don't (or are indifferent - as in this case) is not really a discussion of the merits of the suggestion. Please take the time to support your opinions with some arguments

As for the suggestion: I like to do text manipulation projects at times and I would love to have this block. Sure, there are ways to work around it - but they are not very clean. However, I also recognize that Scratch is intended to be simple to learn - and one way to keep it simple is to limit the number of blocks. So there have to be some very compelling benefits before a new block is added to the pallet.

Don't get annoyed, just add the blocks, please.
Scratchedbyyou
Scratcher
100+ posts

letters () to () of () block

Replication can get complicated:
define letters (min) to (max) of (text)
//no screen refresh enabled
set [output v] to []
if <(round (min::custom)) > (round (max::custom))> then
set [i v] to (round (max::custom))
repeat (((round (min::custom)) - (round (max::custom))) + (1))
set [output v] to (join (output) (letter (i) of (text::custom)))
change [i v] by (1)
end
else
if <(round (min::custom)) = (round (max::custom))> then
set [output v] to (letter (round (min::custom)) of (round (text::custom)))
else
set [i v] to (round (min::custom))
repeat (((round (max::custom)) - (round (min::custom))) + (1))
set [output v] to (join (output) (letter (i) of (text::custom)))
change [i v] by (1)
end
end
end

Yeah I might have overdone it. It could be a little smaller.

With this suggestion we don't need to make a huge mess in a custom block just to replicate it, and there's barely any issues with adding it if any.

Last edited by Scratchedbyyou (April 23, 2024 15:53:04)

Scratchedbyyou
Scratcher
100+ posts

letters () to () of () block

Bobmr2024 wrote:

Paddle2See wrote:

lalala3 wrote:

TheHockeyist wrote:

Indifferent.
Then don't post.
I get a bit annoyed when I see really short responses to suggestions. Simply saying you support or don't (or are indifferent - as in this case) is not really a discussion of the merits of the suggestion. Please take the time to support your opinions with some arguments

As for the suggestion: I like to do text manipulation projects at times and I would love to have this block. Sure, there are ways to work around it - but they are not very clean. However, I also recognize that Scratch is intended to be simple to learn - and one way to keep it simple is to limit the number of blocks. So there have to be some very compelling benefits before a new block is added to the pallet.

Don't get annoyed, just add the blocks, please.
He's a moderator, implementing suggestions are not his job.
Bobmr2024
Scratcher
100+ posts

letters () to () of () block

PLEASE ADD THE BLOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOCK

(letters (1) though (3) of [world] :: operators)
medians
Scratcher
1000+ posts

letters () to () of () block

Bobmr2024 wrote:

Paddle2See wrote:

As for the suggestion: I like to do text manipulation projects at times and I would love to have this block. Sure, there are ways to work around it - but they are not very clean. However, I also recognize that Scratch is intended to be simple to learn - and one way to keep it simple is to limit the number of blocks. So there have to be some very compelling benefits before a new block is added to the pallet.
Don't get annoyed, just add the blocks, please.
1. The post was from 2014 when 2.0 was the current version, this was over..
2. He's not really a developer, just a moderator.
3. Read the last sentence of his statement.
Bobmr2024
Scratcher
100+ posts

letters () to () of () block

Paddle2See wrote:

lalala3 wrote:

TheHockeyist wrote:

Indifferent.
Then don't post.
I get a bit annoyed when I see really short responses to suggestions. Simply saying you support or don't (or are indifferent - as in this case) is not really a discussion of the merits of the suggestion. Please take the time to support your opinions with some arguments

As for the suggestion: I like to do text manipulation projects at times and I would love to have this block. Sure, there are ways to work around it - but they are not very clean. However, I also recognize that Scratch is intended to be simple to learn - and one way to keep it simple is to limit the number of blocks. So there have to be some very compelling benefits before a new block is added to the pallet.

Hello, we need new blocks
BigNate469
Scratcher
1000+ posts

letters () to () of () block

say (letters (1) to (4) of [Bumping this topic]::operators)
^ outputs “Bump”
mysinginmonsters
Scratcher
100+ posts

letters () to () of () block

Sure, this is a much more powerful version of the “letter () of ()” block, but would it help new coders with the concept of substring?

Substring is typically structured in this way:

(letters starting at (2) length (3) of [world] :: operators)

This is also how it works in Excel.

So if the substring block was structured like that, it would definitely prepare new coders but it would be more complicated.
_

Last edited by mysinginmonsters (March 7, 2025 02:43:22)

Bo_Tie
Scratcher
87 posts

letters () to () of () block

mysinginmonsters wrote:

Sure, this is a much more powerful version of the “letter () of ()” block, but would it help new coders with the concept of substring?

Substring is typically structured in this way:

(letters starting at (2) length (3) of [world] :: operators)

This is also how it works in Excel.

So if the substring block was structured like that, it would definitely prepare new coders but it would be more complicated.
_
a few programming languages do this, but most of them do it exactly how this suggestion does it: with a start and end index. python, java, lua, and javascript, for example, all do it that way (besides, scratch is no stranger to simplifying things that are basically universal in other languages, like indexes start at 1 instead of 0, which is something basically only shared by lua)

anyway, on the suggestion itself: HUGE support, text parsing is one of the clunkiest parts of scratch and this block would make it a lot better

Last edited by Bo_Tie (March 7, 2025 16:05:49)

Powered by DjangoBB