Discuss Scratch

-Kryptonite-
Scratcher
1000+ posts

split blocks

mitdk wrote:

More uses for this block can be:
\
  • Breaking down saving codes
    Getting first/last name
    breaking down long strings/integers
    making a sentence a list of words

Support, these reasons are why ^^
mitdk
Scratcher
1000+ posts

split blocks

bump
mitdk
Scratcher
1000+ posts

split blocks

bump
mitdk
Scratcher
1000+ posts

split blocks

bump
mitdk
Scratcher
1000+ posts

split blocks

bump
mitdk
Scratcher
1000+ posts

split blocks

bump, pretty much the whole page is bumps

Last edited by mitdk (July 12, 2021 23:11:14)

mitdk
Scratcher
1000+ posts

split blocks

bump
mitdk
Scratcher
1000+ posts

split blocks

bump
HTML_JAVASCRIPT_CSS
Scratcher
100+ posts

split blocks

I support. This would be useful.

(section (2) of [x,y,z] on [,] :: operators) // returns y

However, there is a possible workaround.

define var = section (x) of [y] on [z]
set [start v] to [1]
set [part v] to [1]
set [length v] to (length of (y))
set [str v] to []
repeat until <(start) > (length)>
set [char v] to (letter (start) of (y))
if <(char) = (z)> then
if <(part) = (x)> then
set [var v] to (str)
stop [this script v]
end
change [part v] by (1)
set [str v] to []
else
set [str v] to (join (str)(char))
end
end
Then you can get the result from the variable “var”.

Note: There is a mistake. You can find the fixed post here: https://scratch-mit-edu.ezproxyberklee.flo.org/discuss/post/5438387/

Last edited by HTML_JAVASCRIPT_CSS (July 16, 2021 00:24:02)

lapisi
Scratcher
1000+ posts

split blocks

HTML_JAVASCRIPT_CSS wrote:

I support. This would be useful.

(section (2) of [x,y,z] on [,] :: operators) // returns y

However, there is a possible workaround.

define var = section (x) of [y] on [z]
set [start v] to [1]
set [part v] to [1]
set [length v] to (length of (y))
set [str v] to []
repeat until <(start) > (length)>
set [char v] to (letter (start) of (y))
if <(char) = (z)> then
if <(part) = (x)> then
set [var v] to (str)
stop [this script v]
end
change [part v] by (1)
set [str v] to []
else
set [str v] to (join (str)(char))
end
end
Then you can get the result from the variable “var”.
that is an extremely complex workaround
HTML_JAVASCRIPT_CSS
Scratcher
100+ posts

split blocks

lapisi wrote:

HTML_JAVASCRIPT_CSS wrote:

I support. This would be useful.

(section (2) of [x,y,z] on [,] :: operators) // returns y

However, there is a possible workaround.

define var = section (x) of [y] on [z]
set [start v] to [1]
set [part v] to [1]
set [length v] to (length of (y))
set [str v] to []
repeat until <(start) > (length)>
set [char v] to (letter (start) of (y))
if <(char) = (z)> then
if <(part) = (x)> then
set [var v] to (str)
stop [this script v]
end
change [part v] by (1)
set [str v] to []
else
set [str v] to (join (str)(char))
end
end
Then you can get the result from the variable “var”.
that is an extremely complex workaround
i know

this is why i support
HTML_JAVASCRIPT_CSS
Scratcher
100+ posts

split blocks

I realized there was a mistake, here is the correct one:
define var = section (x) of [y] on [z]
set [start v] to [1]
set [part v] to [1]
set [length v] to (length of (y))
set [str v] to []
repeat until <(start) > (length)>
set [char v] to (letter (start) of (y))
if <(char) = (z)> then
if <(part) = (x)> then
set [var v] to (str)
stop [this script v]
end
change [part v] by (1)
set [str v] to []
else
set [str v] to (join (str)(char))
end
change [start v] by (1)
end
You can get the code here: https://scratch-mit-edu.ezproxyberklee.flo.org/projects/553597617
mitdk
Scratcher
1000+ posts

split blocks

bump
mitdk
Scratcher
1000+ posts

split blocks

bump
HTML_JAVASCRIPT_CSS
Scratcher
100+ posts

split blocks

bumpity bump bump
SonicFanX123_321
Scratcher
1000+ posts

split blocks

ah, so like this?

(in Squeak Smalltalk)
'Hello!' findTokens: 'l'
output:
(OrderedCollection) 'He','o!'
Mrcakeyman89
Scratcher
1000+ posts

split blocks

Support. This would be really interesting, and helpful. I don't see how this would be too complicated for new scratchers as most new scratchers joining are younger and probabbly don't understand algebra and so don't understand those blocks but they're still in xD

I think it'd be smarter to have some sort of built in seperator, as scratchers have to fully know how to use it to… well… use it. As well as the fact that you can't have both text and a boolean in a text/boolean port. If we had it like the “Join” script, then we can layer it, while still having the same idea. Kinda like what SonicFanX123_321 showed here.

Thanks for Suggesting!
Scratch On!

Last edited by Mrcakeyman89 (July 31, 2021 18:37:49)

mitdk
Scratcher
1000+ posts

split blocks

bump
mitdk
Scratcher
1000+ posts

split blocks

bump
HTML_JAVASCRIPT_CSS
Scratcher
100+ posts

split blocks

bump

Powered by DjangoBB