Discuss Scratch
- SonicFanX123_321
-
Scratcher
1000+ posts
Replace letter () of () with ()
you can use block and then use result variableI think there should be aOMEGA SUPPORT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! because it's useful(replace letter () of [] with []::operators)This would be extremely helpful for variables!
It would show in the block library as(replace letter (1) of [jello world!] with [h]::operators)If somebody knows a simple workaround that would also work.it's a stack, not a reporterdefine replace letter (letter) of [text] with [string]
set [i v] to [1]
repeat (length of (text))
add (letter (i) of (text)) to [tmp v]
change [i v] by (1)
end
replace item (letter) of [tmp v] with (string)
set [result v] to (tmp :: list)
- 6d66yh
-
Scratcher
100+ posts
Replace letter () of () with ()
Ah yes, linear complexity array writes. Seriously, there should be native integer arithmetic in Scratch.define replace letter (letter) of [text] with [string]
set [i v] to [1]
repeat (length of (text))
add (letter (i) of (text)) to [tmp v]
change [i v] by (1)
end
replace item (letter) of [tmp v] with (string)
set [result v] to (tmp :: list)
- BossBoss2011
-
Scratcher
4 posts
Replace letter () of () with ()
I aggree,
() contains []should exist!
define I aggree!
broadcast [I aggree!] to the world
Last edited by BossBoss2011 (Jan. 14, 2022 14:40:53)
- Myst--
-
Scratcher
100+ posts
Replace letter () of () with ()
Semi-Support. There is a workaround but I wouldn't call it an easy one lol.
Last edited by Myst-- (Jan. 14, 2022 16:34:31)
- qloakonscratch
-
Scratcher
1000+ posts
Replace letter () of () with ()
No support. Not because there's a workaround (most existent blocks in Scratch have a workaround), but because its potential applications are limited. It could also confuse newer coders. They could try this:Rework of it:(replace letter (1) of (my variable) with [a]::operators)thinking that it would modify the variable.
(replace (1) of (my variable) with [a]::operators)
If my variable was 1, it would report 1. 923.4 would report 9.
- A-KouZ1
-
Scratcher
100+ posts
Replace letter () of () with ()
i hate scratch 3's 200k list limitMore logic blockseasiest method:set [mytext v] to [there's is manyyyyyyyyyyyyy typos here]
replace letter between (16) to (27) with [] of (mytext)//if u want remove a letter lol
set [mytext v] to (output::list)
define replace letter between (least) to (most) with (new) of (string)
delete [all v] of [output v]
set [i v] to [0]
repeat ((least)-(1))
change [i v] by (1)
add (letter (i) of (string)) to [output v]
end
set [i v] to [0]
repeat ((most)-(least))
change [i v] by (1)
add (letter (i) of (new)) to [output v]
end
set [i v] to ((most)+(1))
repeat ((length of (string))-(most))
change [i v] by (1)
add (letter (i) of (string)) to [output v]
enddefine replace letter between (least) to (most) with (new) of (string)
set [output v] to []
set [count v] to [0]
repeat (length of (string))
change [count v] by (1)
if <(count) = (least)> then
set [output v] to (join (output) (new))
else
if <not <<((least) - (1)) < (count)> and <((most) + (1)) > (count)>>> then
set [output v] to (join (output) (letter (count) of (string))
end
end
end
replace letter between (4) to (6) with [] of [easiwyy!]
say (output)
//output = easy!
- LAVEna_THe_NicE_Guy
-
Scratcher
54 posts
Replace letter () of () with ()
This might be cooler
(Replace [] with [] in []:: reporter operators)Who can make this
Last edited by LAVEna_THe_NicE_Guy (Aug. 17, 2022 23:50:20)
- LAVEna_THe_NicE_Guy
-
Scratcher
54 posts
Replace letter () of () with ()
This is a interesting idea. Such block will allow for things like spell checking in projects.(I like this idea)wow cool block
Last edited by LAVEna_THe_NicE_Guy (Aug. 26, 2022 11:36:46)
- LAVEna_THe_NicE_Guy
-
Scratcher
54 posts
Replace letter () of () with ()
actually the signature I guesThis is a interesting idea. Such block will allow for things like spell checking in projects.Rejected Boolean event block(I like this idea)
- Creator-H
-
Scratcher
100+ posts
Replace letter () of () with ()
Not really helpful, look at the workaround at the first page
- spocite
-
Scratcher
500+ posts
Replace letter () of () with ()
complete support. there are definitely workarounds, but this would be miles better as its easier (there isn't an operator version of the custom scripts), and its faster!
- -ErrorPurpl_157
-
Scratcher
100+ posts
Replace letter () of () with ()
-snip-
It's better than this method:define change (character#) of string to (new character)
set [changer v] to []
set [item# v] to (1)
repeat ((character#) - (1))
set [changer v] to (join (changer) (letter (item#) of (string)))
change [item# v] by (1)
end
set [changer v] to (join (changer) (new character))
set [item# v] to ((character#) + (1))
repeat ((length of (string)) - (character#)
set (changer) to (join (changer) (letter (item#) of (string)))
change [item# v] by (1)
end
set [string v] to (changer
*internal screaming*- -ErrorPurpl_157
-
Scratcher
100+ posts
Replace letter () of () with ()
I aggree,It exists, check the editor<() contains [] :: operators>should exist!
-snip-
- AndrewB1501
-
Scratcher
500+ posts
Replace letter () of () with ()
It didn't exist until 3.0, and that is a post from 2.0. It wasn't there back then, but it is now.I aggree,It exists, check the editor<() contains [] :: operators>should exist!
-snip-
- medians
-
Scratcher
1000+ posts
Replace letter () of () with ()
Can confirm, person with the same profile picture as me.It didn't exist until 3.0, and that is a post from 2.0. It wasn't there back then, but it is now.I aggree,It exists, check the editor<() contains [] :: operators>should exist!
-snip-
Anyway, maybe these blocks alongside this?
(index of [t] in [string] ::operators)
(index of [thing] in [list v] ::list)
Last edited by medians (June 2, 2023 18:09:49)
- -OdysseyCentral-
-
Scratcher
1000+ posts
Replace letter () of () with ()
No support. Usually I wouldn’t put “no support” just because of a workaround, but the workaround isn’t that hard imo and it’s one of the workarounds I personally enjoyed finding, and I usually don’t enjoy working around non-existing blocks, but this one is really cool.
- IHEL-
-
Scratcher
2 posts
Replace letter () of () with ()
oldest most relevant topic 









































































think [:)] for (2) secs













