Discuss Scratch
- Discussion Forums
- » Suggestions
- » New Operator block: letters _ to _ of _
- minecraftpawa
-
Scratcher
100+ posts
New Operator block: letters _ to _ of _
Currently, getting part of a variable is complicated since Scratch only supports getting one letter of a variable at a time. The following block would be easily understandable and useful. (For splitting variables, for example.)
(letters () to () of [world] :: operators)
Last edited by minecraftpawa (Feb. 9, 2022 14:25:42)
- Autofirejm
-
Scratcher
1000+ posts
New Operator block: letters _ to _ of _
Currently, getting part of a variable is complicated since Scratch only supports getting one letter of a variable at a time. The following block would be easily understandable and useful. (For splitting variables, for example.)How would this work? would it do something like(letters () to () of [world] :: operators)
(Letters (a) to (a) of [papaya] :: operators) // apayaOr
(Letters (a) to (a) of [papaya] :: operators) // a
- minecraftpawa
-
Scratcher
100+ posts
New Operator block: letters _ to _ of _
Currently, getting part of a variable is complicated since Scratch only supports getting one letter of a variable at a time. The following block would be easily understandable and useful. (For splitting variables, for example.)How would this work? would it do something like(letters () to () of [world] :: operators)(Letters (a) to (a) of [papaya] :: operators) // apayaOr(Letters (a) to (a) of [papaya] :: operators) // a
(letters (1) to (3) of [world] :: operators)outputs wor.
Letter detection in variables would be nice too, but it'd likely be more complicated and would be a separate thing.
Last edited by minecraftpawa (Feb. 9, 2022 15:00:29)
- jtarps
-
Scratcher
28 posts
New Operator block: letters _ to _ of _
Support I had an issue with that yesterday and had to use
(join (join (letter (2) of (word)) (letter (3) of (word))) (join (letter (4) of (world)) (letter (5) of (world))))it wasn't fun
- MagicCoder330
-
Scratcher
1000+ posts
New Operator block: letters _ to _ of _
Support. this makes a lot of sense
- smisamul6
-
Scratcher
100+ posts
New Operator block: letters _ to _ of _
Support! This would be veeery useful.
- Spaceboy1010
-
Scratcher
100+ posts
New Operator block: letters _ to _ of _
Support! I too had to do a billion join blocks, this would make things a whole lot easier.
- minecraftpawa
-
Scratcher
100+ posts
New Operator block: letters _ to _ of _
Support I had an issue with that yesterday and had to useIt's even worse if the length of the part you need to get doesn't stay the same, because in that case you need to do something like this:(join (join (letter (2) of (word)) (letter (3) of (word))) (join (letter (4) of (world)) (letter (5) of (world))))it wasn't fun
define getsection (start) (length) (word)
set [i v] to (start)
set [storage v] to []
repeat (length)
set [storage v] to (join (storage) (letter (i) of (word)))
change [i v] by (1)
end
- twogadugary
-
Scratcher
100+ posts
New Operator block: letters _ to _ of _
Having it in a reporter would be far more easy and convenient than having to make a workaround script, and this wouldn't confuse new or younger users.
- Icefan13
-
Scratcher
100+ posts
New Operator block: letters _ to _ of _
support. Maybe also a block like
(letters [after v] () of [world]::operators//reports all the letters before or after the given value
- minecraftpawa
-
Scratcher
100+ posts
New Operator block: letters _ to _ of _
support. Maybe also a block likeMaybe, but that could relatively easily be done with something like this:(letters [after v] () of [world]::operators//reports all the letters before or after the given value
(letter (5) to (length of (word)) of (word)::operators)I don't think a ‘letters after x’ block is useful enough to warrant being added, and would simply make the operators section more cluttered.
Last edited by minecraftpawa (Feb. 11, 2022 14:07:08)
- Discussion Forums
- » Suggestions
-
» New Operator block: letters _ to _ of _