Discuss Scratch

PATSATDAT
Scratcher
1000+ posts

The Opposite of the Join Block

Support this would be useful in search engine projects
King of the page

Last edited by PATSATDAT (March 22, 2021 11:55:31)

Leekalo
Scratcher
100+ posts

The Opposite of the Join Block

StevenTheSquare wrote:

mmm… semi-support. this function exists in python as find, where it will pick all the “yays” out and then you can delete them or put spaces between them or stick them into a separate variable or whatever. it's kinda useful for combing (like, I have a downloaded pdf of my physics and astronomy textbooks, and I used python to pick out all the equations and put them in a .txt file at the beginning of the school year) but I'm not sure what use it would have on scratch… it's a bit too advanced of a concept for scratch's younger audience I think
I don't think you can modify Strings in Python, because they're immutable.

Last edited by Leekalo (March 22, 2021 13:55:56)

warriorcats2155
Scratcher
500+ posts

The Opposite of the Join Block

Support, easy to implement and is very important in some projects!
Totodile_star
Scratcher
500+ posts

The Opposite of the Join Block

Support THATS WHAT WE NEEDED ALL ALONG
cooldude-222
Scratcher
100+ posts

The Opposite of the Join Block

Bump
samq64
Scratcher
1000+ posts

The Opposite of the Join Block

Is this
(letters () to () of []::operators)
related or is it a separate suggestion?
the2000
Scratcher
1000+ posts

The Opposite of the Join Block

samq64 wrote:

Is this
(letters () to () of []::operators)
related or is it a separate suggestion?
Pretty much all that these have in common is that they're related to string manipulation. I'm not sure how you could mix them up…
han614698
Scratcher
1000+ posts

The Opposite of the Join Block

Bump
Pianostar4
Scratcher
1000+ posts

The Opposite of the Join Block

At first I thought it meant split it, which is impossible for computers to understand. But I must say, this is a really good idea! Support!
gosoccerboy5
Scratcher
1000+ posts

The Opposite of the Join Block

Hmm, I would support this:
replace [all v] of [] from [] with [] :: operators reporter
replace [first v] of [] from [] with [] :: operators reporter
replace [last v] of [] from [] with [] :: operators reporter
You can leave the first slot empty to “delete” the text.
(I suppose this wouldn't be as intuitive as a simple delete block, but it is a bit more versatile)
mitdk
Scratcher
1000+ posts

The Opposite of the Join Block

Also,
(delete letter () of []::operators)
CobraScripts
Scratcher
38 posts

The Opposite of the Join Block

Very useful, especially for the kinds of projects I make. I currently use a script like this:
set [data v] to [Splitting Strings]
set [firstdat v] to []
set [n v] to [1]
repeat until <(letter (n) of (data)) = [ ]>
set [firstdat v] to (join (firstdat) (letter (n) of (data))
change [n v] by (1)
end
say (firstdat) //outputs "Splitting"
But a script like this:
set [data v] to [Splitting Strings]
say (split (data) at first [ ] ::operators) //still outputs "Splitting"
is so much cleaner and less annoying! I really want this as either an extention or as a new Operator block.
tinycoder8675
Scratcher
100+ posts

The Opposite of the Join Block

Full support. This would be very useful for certain projects.
coincidenceithink
New Scratcher
9 posts

The Opposite of the Join Block

mitdk wrote:

Also,
(delete letter () of []::operators)
here's a workaround though
define delete letter (ltr) of (word)
delete (all v) of [ltrs v]
repeat (length of (word))
add (letter (length of [ltrs v] ::list) of (word)) to [ltrs v]
end
delete (ltr) of [ltrs v]
set [result v] to []
repeat (length of [ltrs v] :: list)
set [result v] to (join (result) (item (length of (result) + (1) ::operators) of [ltrs v] :: list))
end
support for the original because this would be helpful for decoding and other stuff and the workaround is a bit long especially for new scratchers
fox_creations
Scratcher
63 posts

The Opposite of the Join Block

xXRedTheCoderXx wrote:

(delete [first v] [c] of [car] :: operators)
(delete [last v] [c] of [car] :: operators)
(delete [all v] [c] of [car] :: operators)

The output would be “ar” because it is deleting the c from car. What happens when something like this is put in you ask?

(delete [all v] [yay] of [yayyayyayyaytyayyayyay] :: operators)

The output would be “t”
Okay here's more examples:

(delete [first v] [yay] of [yayyayyayyaytyayyayyay] :: operators)

Output: yayyayyaytyayyayyay

(delete [last v] [yay] of [yayyayyayyaytyayyayyay] :: operators)

Output: yayyayyayyaytyayyay

(delete [all v] [h] of [hi there! ;D] :: operators)

Output: i tere! ;D

I hope you like my idea. If you found a duplicate, please tell me. I couldn't find one.

PLEASE NOTE THAT THE LIST IS NO LONGER BEING UPDATED. THANK YOU. VVVVV
Support

Last edited by fox_creations (Oct. 1, 2021 15:49:44)

man-o-valor
Scratcher
94 posts

The Opposite of the Join Block

SUPPORT! I have had a situation like this where i needed to delete a character from the end of a variable. I made a workaround but it made me think about why there is not a block like this. If you are curious what this project is, it's scratch.mit.edu/projects/724040656
man-o-valor
Scratcher
94 posts

The Opposite of the Join Block

Yellowsheep43 wrote:

Anyways, according to the post above, yes, I do support this. Below is the entire quote from the topic I made

There is, however, a problem of if there are multiple examples of something.
(Remove [an] from [banana] :: operators)
To solve this, there could be another block that could look like this:
(Remove [first v] example of [an] from [banana] :: operators) // The result would display as "bana"
If # is put into (example of ___), it will remove the number depending on which example it should remove (unless there is a hashtag already in the phrase it must remove it from)
The block can detect “First,” “Second,” “Last,” or “All” instances of a letter, number, or phrase, examples below:
set [Score v] to (Remove [last v] example of [0] from (Score) :: operators) :: variables
set [Time v] to (timer)
set [Time v] to (join (Remove [last v] example of [#] from (Time) :: operators) [0] :: operators // This script sets the time to the rounded down time the timer displays
This block would make it possible to have scripts that always round down. If anyone has any input, please tell me.

Suprise! there is a block that rounds down. it's in the dropdown of the abv operations block and it's called floor. (rounding up is called ceiling.)

([floor v] of (0.9))
say [returns 0]
medians
Scratcher
1000+ posts

The Opposite of the Join Block

when green flag clicked
set [page v] to [1]
radians
Scratcher
54 posts

The Opposite of the Join Block

medians wrote:

when green flag clicked
set [page v] to [1]
Kitten-da-Cat
Scratcher
1000+ posts

The Opposite of the Join Block

medians wrote:

when green flag clicked
set [page v] to [1]
Please do not bhlodk spamamamaM

Powered by DjangoBB