Discuss Scratch

stickfiregames
Scratcher
1000+ posts

letters () to () of () block

lalala3 wrote:

stickfiregames wrote:

Support since other programming languages can do this. Also the workaround is very slow as I noticed when I used it to make a cloud encoder.
Even with the “no screen refresh” thing disabled? Wow.
Why didn't I think of doing that?








If you can read this, my signature cubeupload has been eaten by an evil kumquat!

or you just used Inspect Element

;
MushroomMan99
Scratcher
100+ posts

letters () to () of () block

If a New Scratcher wanted to make a Pig Latin translator like I did, the workaround would be far too complicated for them to understand so even if limiting the number of blocks makes things simpler, I still think it would be simpler to have the block

when green flag clicked
if <(language) = [English ]> then

say [Everything is Awesome!] for (2) secs
end
if <(language) = [French ]> then

say [Tout est super-genial!] for (2) secs
end
if <(language) = [Italian ]> then

say [E meraviglioso!] for (2) secs
end
if <(language) = [Spanish ]> then

say [Todo es fabuloso!] for (2) secs
end
samanyolu
Scratcher
1000+ posts

letters () to () of () block

+1
DadOfMrLog
Scratcher
1000+ posts

letters () to () of () block

I've madeitclearbefore… (alongside many others) that I'd really like to see this block added - it would simplify the scripting of so many other string operations!

Paddle2See wrote:

I get a bit annoyed when I see really short responses to suggestions.
*Asks slightly nervously*… What about really long responses…? (Well, you did say “Please take the time to support your opinions with some arguments”!)


Paddle2See wrote:

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.
Apart from, as I mentioned at the start, making so many other things simpler, one compelling benefit is speed.

Scratch is relatively slow, since it has to perform translation of the blocks. That means the workaround takes several orders of magnitude longer than a built-in block would. And Scratch could really use all the help it can get, where doing so has no barriers to understanding - I have a hard time believing that anyone who can understand “letter N of STRING” would struggle with “letters M to N of STRING”. And as mentioned above, a built-in block is clearly way simpler than having to work out the script yourself.

It could be argued that it takes away the opportunity to learn a useful script. However, I have to admit that I can't see it as much of a loss, since the same basic loop construction appears in so many other situations…


astro-mechanic wrote:

Ah yes, slicing. Unfortunate for the undefined behaviors here, such as invalid indexes. Will the starting index be inclusive and the ending index be exclusive, as in Python, such that end - start = length? Or will both be inclusive?
I don't see any ambiguity in the *meaning* here - the wording makes it clear (unlike a not-immediately-determinative operator name like ‘slice’ or some form of indexing).

However, the behaviour for cases like M<1, and/or N>length… I'd say it should just take its cue from the current behaviour of “letter N of STRING”, which ignores those parts beyond the start and end. As for M>N, well…

astro-mechanic wrote:

A text reverse block would go well with this.
As it happens, the string-manipulation project in my sig has a “letters M to N of STRING” custom block, and that reverses the order of characters if M>N.
(Not suggesting a native ‘letters M to N" block should do that, though I’d hardly complain if there was a faster built-in way to do such a reversing…)

Last edited by DadOfMrLog (Aug. 27, 2014 16:41:46)



Alternate account: TheLogFather –– HowTos and useful custom blocks (see studio). Examples below…


- String manipulation - - - X to power of Y - - - Clone point to clone - Detect New Scratcher - Speed tests studio -

imadrainpipe
Scratcher
100+ posts

letters () to () of () block

this would be very useful for compiling lists

TimothyLawyer
Scratcher
1000+ posts

letters () to () of () block

lalala3 wrote:

letters (1) to (3) of [world] :: custom
say (return) for (2) secs
Honestly, though, that's why we need custom reporter blocks in general.
say (letters (1) to (3) of [yes custom operators] :: custom) for (3e7) secs
Dmith
Scratcher
1000+ posts

letters () to () of () block

HOWING
Scratcher
500+ posts

letters () to () of () block

MushroomMan99 wrote:

I am suggesting a block like this
(letters (1) to (3) of [world])
What section does this go?

Check out my most popular game! Check out my cool apple catcher! Check out my awesome Bullet Bill Dodge!
TimothyLawyer
Scratcher
1000+ posts

letters () to () of () block

HOWING wrote:

What section does this go?
It would be an operator
(letters (1) to (3) of [world] :: operators)
similar to letter ( ) of [ ].
KingOfAwesome58219
Scratcher
1000+ posts

letters () to () of () block

That would be useful for games like Hangman. Support.



xX_Damion_Xx
Scratcher
38 posts

letters () to () of () block

FULL SUPPORT!

REAAAALY useful for online saving.
Charles12310
Scratcher
1000+ posts

letters () to () of () block

This block should definitely be added for many purposes such as quizzes, and so we don't have to keep on using join blocks, and so we don't have to do too much scripting for detection.

Last edited by Charles12310 (Oct. 11, 2017 23:14:50)

MCGUY15
Scratcher
100+ posts

letters () to () of () block

(letters (2) to (8) of (qsupportdjjfisnvoa)

when green flag clicked
play sound [Rick Astley - Never Gonna Give You Up v]
change volume to (over 9000) :: sound
Also check out my Shop. Or not.
gavinskycastle
Scratcher
66 posts

letters () to () of () block

MushroomMan99 wrote:

I am suggesting a block like this
(letters (1) to (3) of [world])

Cool idea! I've made scripts that act similarly to this, but this would definitely oversimplifiy it .
Charles12310
Scratcher
1000+ posts

letters () to () of () block

walkcycle
Scratcher
500+ posts

letters () to () of () block

Charles12310 wrote:

SUPPORT
Why?

Early email history
[ ⤤ ] # ’puting punctuation
5e1 - 0o10
pound foolish scratch.mit.edu/discuss/topic/97026/
108 109 111 114 115 117 120 123 126 127 129 132 133 135 138 141 144 145 147 150 151 153 156 159 162 163 165 168 169 171 174 177Universal Basic


0 1 3 6 7 9 12 15 18 19 21 24 25 27 30 33 36 37 39 42 43 45 48 51 54 55 57 60 63 66 69 72 73 75 78 79 81 84 87 90 93 96 97 99 102 105 The Truly Great
say [ relax and enjoy tomorrow today! ] // ' the ' + 0x11 - 0o21 + 0b10001 + 'th ' + 1 
Charles12310
Scratcher
1000+ posts

letters () to () of () block

walkcycle wrote:

Charles12310 wrote:

SUPPORT
Why?
Edited my post.
DaEpikDude
Scratcher
500+ posts

letters () to () of () block

Charles12310 wrote:

walkcycle wrote:

Charles12310 wrote:

bump (formerly SUPPORT)
Why?
Edited my post.
yeah ok

//There are 2 types of people in the world:
if () {
...
if ()
{ ...
Unless you use Python.
Like Metroid? Discuss it here, unless you're not authorized to. hooray advertising
;

Powered by DjangoBB

Standard | Mobile