Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do I do this?
- awesomelilbuddy
-
55 posts
How do I do this?
How do I calculate the difference between a number? example: The difference between 1 and 2 is: 1. (Note: I want a clean solution, with only math blocks if possible.)
- legendary34678
-
1000+ posts
How do I do this?
I think what you are looking for is the absolute value of two numbers. You can find the absolute value block in Operators where there is a block called “abs of”.
([abs v] of ((1) - (2))::operators) // results in 1
([abs v] of ((2) - (1))::operators) // also results in 1
- Discussion Forums
- » Help with Scripts
-
» How do I do this?