Discuss Scratch

nothrethianbutbad
Scratcher
5 posts

Operators+ extension

There should be an extension adding new operators.
Here are the operators that come with the extension.
((0) ↑ (0)::operators)
If it showed 4↑2 it would report 16 because 4↑2=16. Exponentation.


(remove all instances of [a] in [apples are fruits]::operators)
If the reporter was in this state it would return pples re fruits because it removes all of (a). If you were to put in (a, e) in the first thing, it would remove (a) and (e) silly enough if you put in (a, e, s) you get “ppl r fruit”


(amount of [a] in [banana]::operators)
If the reporter was in this state, it would return 3 because there are 3 instances of “ a” in banana.


(amount of [vowels v] in [tangerine]::operators)
If the reporter was in this state, it would return 4 because there are 4 instances of vowels in “tangerine”.


(amount of [consonants v] in [tangerine]::operators)
Same as the last one, but uses consonants. Therefore, it returns 5 because….well, you get it.


(round (2) to (3)::operators)
It would return 3 because 2 is closest to 3.


(change [c] to [y] in [coconut]::operators)
Pretty simple. C gets changed to y so it reports “yoyonut”
Let me know what you think about this!
DragonBeast829
Scratcher
100+ posts

Operators+ extension

This should probably be in Suggestions, this category is for the development and implementation of extensions.

Also, for some feedback: these blocks would probably be better off as being implemented yourself as functions, but Scratch doesn't have those yet. Here's to hoping 4.0 adds functions!
lousylittlelosers
Scratcher
1 post

Operators+ extension

i need there to be an exponent as well but I think is should use the caret symbol instead (^) . as well as that I think that there should be a root operator that you can select what root number you are using like this
((3) ^/(27))
scratching6712
Scratcher
95 posts

Operators+ extension

( if <boolean :: custom> then [foo] else [bar] :: operators) // would return "foo" if <boolean> is true, else, would return bar
( - [6] :: operators) // would return "-6" because it turns any number in there negative
([ello] to [uppercase v] :: operators) // pretty self explanatory
( time it takes to do function { block :: custom } :: operators) // also self explanatory
< [2] is a [multiple v] of [10] ? :: operators> // false
nothrethianbutbad
Scratcher
5 posts

Operators+ extension

scratching6712 wrote:

( if <boolean :: custom> then [foo] else [bar] :: operators) // would return "foo" if <boolean> is true, else, would return bar
( - [6] :: operators) // would return "-6" because it turns any number in there negative
([ello] to [uppercase v] :: operators) // pretty self explanatory
( time it takes to do function { block :: custom } :: operators) // also self explanatory
< [2] is a [multiple v] of [10] ? :: operators> // false

Okay but there is a workaround for:
( - [6] :: operators)

which is

((number) * (-1) :: operators)
but yeah most of these are cool

Powered by DjangoBB