Discuss Scratch

-WhoAsked-
Scratcher
79 posts

Invert block?

Hi, I am planning on making a project, but I need to invert a specific number to another one, here is an example:

(() Invert ()::operators)
This is used for this purpose:



((75) Invert (100)::operators)
//Will become 25
((25) Invert (100)::operators)
//Will become 75
((50) Invert (50)::operators)
//Will become 10


So you can for example make pitch higher depending on distance to mouse pointer, instead of lower, like this:

set [pitch v] effect to ((distance to [mouse pointer v]) Invert (100)::operators)::sound

NEW ACCOUNT! @IEatButterCups
Quantum-Cat
Scratcher
1000+ posts

Invert block?

Can't you use subtraction?

Notice: Everything below the solid grey line (↑↑) above is my signature and appears on every post I make. Here, it is okay for you to advertise
your projects and other creations. To create your own, scroll to the bottom of the Discussion Home page and select “change your signature”.

I aplogise if I seem a bit too serious on the forums, but I am always open to feedback on my profile.
Past PPTBF Curator || Forum Helper (TFH) || Some Python, HTML and C

————————————————————————————

————————————————————————————
Quantum-Cat
-WhoAsked-
Scratcher
79 posts

Invert block?

Quantum-Cat wrote:

Can't you use subtraction?
(25)-(100)
Is -75

NEW ACCOUNT! @IEatButterCups
-WhoAsked-
Scratcher
79 posts

Invert block?

Quantum-Cat wrote:

Can't you use subtraction?
Well I guess
([abs v] of ((25)-(100)))
has the same function but
((25) Invert (100)::operators)
makes things much easier

NEW ACCOUNT! @IEatButterCups
Quantum-Cat
Scratcher
1000+ posts

Invert block?

-WhoAsked- wrote:

Quantum-Cat wrote:

Can't you use subtraction?
Well I guess
([abs v] of ((25)-(100)))
has the same function but
((25) Invert (100)::operators)
makes things much easier
It is a basic 2 block workaround. I am not sure that a name like ‘invert’ would make much sense at first either.

Notice: Everything below the solid grey line (↑↑) above is my signature and appears on every post I make. Here, it is okay for you to advertise
your projects and other creations. To create your own, scroll to the bottom of the Discussion Home page and select “change your signature”.

I aplogise if I seem a bit too serious on the forums, but I am always open to feedback on my profile.
Past PPTBF Curator || Forum Helper (TFH) || Some Python, HTML and C

————————————————————————————

————————————————————————————
Quantum-Cat
J4NKKY
Scratcher
100+ posts

Invert block?

Quantum-Cat wrote:

-WhoAsked- wrote:

Quantum-Cat wrote:

Can't you use subtraction?
Well I guess
([abs v] of ((25)-(100)))
has the same function but
((25) Invert (100)::operators)
makes things much easier
It is a basic 2 block workaround. I am not sure that a name like ‘invert’ would make much sense at first either.
[abs v] of ((50)-(50)) // returns 0 instead of 10

select text and press shift+down to read all

EVERY OFFICIAL SCRATCH ANNOUNCEMENT HERE

me when the
color fx test ()::looks
block gets readded:

Powered by DjangoBB