Discuss Scratch

-Yugen-
Scratcher
56 posts

Slight "Letter () of" block change

Alright, so we're all acquainted with the lovely
letter () of []
block, but what if we changed it to:
([first v] () letters of []::operators)
What this would allow for is a multiple letter output rather than only a single letter output. Also, the first dropdown box could include 2 things:
([first v] () letters of []::operators)
([last v] () letters of []::operators)
You could always do
([first v] (1) letters of [world]::operators)
and still get the “w” output, but the whole block is improved in general. I don't know about all of you, but I'm tired of making a huge workaround like this:
define Find first (♯) letters of [text]
set [output v] to []
set [i v] to [1]
repeat (♯)
set [output v] to (join (output) (letter (i) of (text)))
change [i v] by (1)
It would just make life so much more simple. Thanks for reading!
jokebookservice1
Scratcher
1000+ posts

Slight "Letter () of" block change

Hmm, sounds good but

-Yugen- wrote:

You could always do
([first v] (1) letters of [world]::operators)
Is only accurate for the first and last letter. I don't see how you could do it for a middle letter, and to get a middle letter you would need a difficult workaround (well, not that difficult)

Maybe an additional block, and even better if it looked lie this:
You could always do
((1) through (3 v) of [world]::operators)
Where the drop-down would contain only last but you could enter your own numeric values, like in the point-towards(angle) block.
Your block could then be made by:
  • If you want the first letters, just type 1 in the first area and the amount of chars in the second.

  • If you want “last” then you need to put “lengthOf(yourString) - AMOUNTofCHARStoGRAB” as the first paramater, and select “last” from the second

That suggestion, I believe, is already suggested.

On the other hand, Scratch is designed to teach kids to program, so it helps if they have to learn how string manipulation actually works by implementing it themselves.


gamebeater187
Scratcher
1000+ posts

Slight "Letter () of" block change

Support.
([middle to right v] letters () of []) :: operators reporter
([middle to left v] letters () of []) :: operators reporter
-Yugen-
Scratcher
56 posts

Slight "Letter () of" block change

jokebookservice1 wrote:

Hmm, sounds good but

-Yugen- wrote:

You could always do
([first v] (1) letters of [world]::operators)
Is only accurate for the first and last letter. I don't see how you could do it for a middle letter, and to get a middle letter you would need a difficult workaround (well, not that difficult)

Maybe an additional block, and even better if it looked lie this:
You could always do
((1) through (3 v) of [world]::operators)
Where the drop-down would contain only last but you could enter your own numeric values, like in the point-towards(angle) block.
Your block could then be made by:
  • If you want the first letters, just type 1 in the first area and the amount of chars in the second.

  • If you want “last” then you need to put “lengthOf(yourString) - AMOUNTofCHARStoGRAB” as the first paramater, and select “last” from the second

That suggestion, I believe, is already suggested.

On the other hand, Scratch is designed to teach kids to program, so it helps if they have to learn how string manipulation actually works by implementing it themselves.


Really very constructive! Thanks for the feedback!

Powered by DjangoBB