Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How to get uh the opposite of a number..?
- ElPandaMasFurro719
-
Scratcher
81 posts
How to get uh the opposite of a number..?
I just seen another post but it just becomes negative, for example, i want the opposite of 100 to be 0, 99 to 1, 98 to 2 and etc.
I'm making a setting of Brightness, which it's default value is 100. ((-1) * (number)) won't work.
I'm making a setting of Brightness, which it's default value is 100. ((-1) * (number)) won't work.
Last edited by ElPandaMasFurro719 (Feb. 23, 2025 15:33:49)
- NoUsername-King
-
Scratcher
100+ posts
How to get uh the opposite of a number..?
you have to subtract it from 100.
((100) - (brightnessLevel))
- 10goto10
-
Scratcher
1000+ posts
How to get uh the opposite of a number..?
Do you want the result of a subtraction?
Update: and I’m too slow again
set [Subtrahend v] to [100]
set [Minuend v] to [2]
set [Opposite v] to ((Subtrahend) - (Minuend))
Update: and I’m too slow again
Last edited by 10goto10 (Feb. 23, 2025 16:49:38)
- ElPandaMasFurro719
-
Scratcher
81 posts
How to get uh the opposite of a number..?
Tysm! it only became more brighter but i fixed it by adding a join!
Why it appears as an extension????????
(join [-] ((100) - (Brightness))
Why it appears as an extension????????
- NotK3ndricAltAgain
-
Scratcher
500+ posts
How to get uh the opposite of a number..?
It appears to be a block of the LEGO EV3 extension.(join [-] ((100) - (Brightness))
Why it appears as an extension????????
- 20_15_13
-
Scratcher
8 posts
How to get uh the opposite of a number..?
I just seen another post but it just becomes negative, for example, i want the opposite of 100 to be 0, 99 to 1, 98 to 2 and etc.I did this but for the ghost effect so idk if it will work for u, but try:
I'm making a setting of Brightness, which it's default value is 100. ((-1) * (number)) won't work.
set [brightness] effect to (100)-((variable))
Last edited by 20_15_13 (Yesterday 21:58:13)
- Discussion Forums
- » Help with Scripts
-
» How to get uh the opposite of a number..?