Discuss Scratch
- Discussion Forums
- » Suggestions
- » "Percentage Between" Operators Block
- Toodchop
-
Scratcher
100+ posts
"Percentage Between" Operators Block
Note: If you’d like, feel free to reply with what you think the benefits of this block could be, or how you might use it in your projects!
Hello! I have a suggestion for a new operators block that could be really helpful for math-based projects. The idea is a “percentage between” block that calculates the percentage of the distance between two numbers. Here's how it would work:
The block would look like this:
For example,
This block would simplify the process of calculating midpoints and percentages without needing to manually use formulas like:
Example use:
It would be a great tool for anyone working with animations, game mechanics, or even math lessons. Let me know what you think!
Hello! I have a suggestion for a new operators block that could be really helpful for math-based projects. The idea is a “percentage between” block that calculates the percentage of the distance between two numbers. Here's how it would work:
The block would look like this:
(50) % between (1) and (5) :: operators reporter
For example,
(50) % between (1) and (5) :: operators reporter : // would return 3 (the midpoint).
(25) % between (1) and (5) :: operators reporter : // would return 2 (a quarter of the way).
This block would simplify the process of calculating midpoints and percentages without needing to manually use formulas like:
(((x) + (y)) / (2))
Example use:
when green flag clicked
forever
go to x: ((50) % between ([x position v] of (red ball v)) and ([x position v] of (blue ball v)) :: operators) y: (0)
end
It would be a great tool for anyone working with animations, game mechanics, or even math lessons. Let me know what you think!
Last edited by Toodchop (Oct. 18, 2025 03:08:49)
- jmdzti_0-0
-
Scratcher
1000+ posts
"Percentage Between" Operators Block
You don’t need different formulae for each percentage:
horrible misinformation in later posts due to a mistake of mine, it’s (b-a), not (a+b)
horrible misinformation in later posts due to a mistake of mine, it’s (b-a), not (a+b)
Last edited by jmdzti_0-0 (Oct. 23, 2025 14:23:34)
- Toodchop
-
Scratcher
100+ posts
"Percentage Between" Operators Block
You don’t need different formulae for each percentage:Oh, I didn't know that!
- jmdzti_0-0
-
Scratcher
1000+ posts
"Percentage Between" Operators Block
Last edited by jmdzti_0-0 (Oct. 23, 2025 14:24:17)
- aaliyaan0110
-
Scratcher
500+ posts
"Percentage Between" Operators Block
i think that would be used for gambl games, no support
Last edited by aaliyaan0110 (Aug. 8, 2025 10:54:18)
- jmdzti_0-0
-
Scratcher
1000+ posts
"Percentage Between" Operators Block
i think that would be used for gambl games, no supportwell, the
(pick random (0) to (10))block can also be used to make gambling games and it’s still there as far as i know. don’t bring up ridiculous arguments to not support.
anyways, i think gambling games ARE allowed on scratch as long as they don’t involve real money and whatnot (* i am using that word way too much today). you can’t monetize projects on scratch at all
Last edited by jmdzti_0-0 (Aug. 8, 2025 18:01:55)
- Toodchop
-
Scratcher
100+ posts
"Percentage Between" Operators Block
also: 25% of (1+5) is 1.5, not 2.This block calculates a given percentage of the range between two numbers, not their sum.
Last edited by Toodchop (Aug. 9, 2025 02:01:21)
- Toodchop
-
Scratcher
100+ posts
"Percentage Between" Operators Block
i think that would be used for gambl games, no supportThis block calculates a given percentage of the range between two numbers, not calculate a chance.
- Quantum-Cat
-
Scratcher
1000+ posts
"Percentage Between" Operators Block
In programming, this operation is usually called lerp (linear interpolation), and the formula is a + (b-a) * percentage/100 (or instead of percentage/100, a parameter t that goes between 0 and 1.0). I think it was suggested a few times before, but I honestly think your phrasing of the block is more beginner-friendly.
- jmdzti_0-0
-
Scratcher
1000+ posts
"Percentage Between" Operators Block
ignore this post
Last edited by jmdzti_0-0 (Sept. 6, 2025 21:54:08)
- medians
-
Scratcher
1000+ posts
"Percentage Between" Operators Block
With the formula given in that post, you cannot do that. You have to follow order of operationsIn programming, this operation is usually called lerp (linear interpolation), and the formula is a + (b-a) * percentage/100 (or instead of percentage/100, a parameter t that goes between 0 and 1.0). I think it was suggested a few times before, but I honestly think your phrasing of the block is more beginner-friendly.a + (b-a) is just b
- ispretty
-
Scratcher
500+ posts
"Percentage Between" Operators Block
you're not accounting for the order of operations, it's a + ((b-a) * percentage/100) (which you can't simplify further)In programming, this operation is usually called lerp (linear interpolation), and the formula is a + (b-a) * percentage/100 (or instead of percentage/100, a parameter t that goes between 0 and 1.0). I think it was suggested a few times before, but I honestly think your phrasing of the block is more beginner-friendly.a + (b-a) is just b
- aaliyaan0110
-
Scratcher
500+ posts
"Percentage Between" Operators Block
how is everybody good at math 

- Toodchop
-
Scratcher
100+ posts
"Percentage Between" Operators Block
how is everybody good at mathI hope the block is NOT too complex for Scratch.
- Za-Chary
-
Scratcher
1000+ posts
"Percentage Between" Operators Block
Just curious, what are some practical uses for this block? In particular, you mention animations and game mechanics, but what specifically can this block be used for in those instances?
- Discussion Forums
- » Suggestions
-
» "Percentage Between" Operators Block






