Discuss Scratch
- Discussion Forums
- » Suggestions
- » New operator (Can't really name it...)
- aw3s0me8
-
24 posts
New operator (Can't really name it...)
Hello! I am trying to make a calculator, but I really don't want to do this:
Thanks!
if <(Operation)=[+]> thenInstead, this operator I made can really help:
set [answer v] to ((Num1)+(Num2))
end
if <(Operation)=[-]> then
set [answer v] to ((Num1)-(Num2))
end
if <(Operation)=[*]> then
set [answer v] to ((Num1)*(Num2))
end
if <(Operation)=[/]> then
set [answer v] to ((Num1)/(Num2))
end
(() (+ v) ()::#5bb117)EXAMPLE BELOW
(Num1) //Equals 6Please try and add it / suggest it to scratch.
(Num2) //Equals 4
(Operation) //Equals +
set [answer v] to ((Num1) (Operation) (Num2)::#5bb117) //I could do this instead- way simpler!
(answer::#ee7d17) //Now equals 10
Thanks!
Last edited by aw3s0me8 (May 11, 2021 12:01:30)
- EatNYeet
-
500+ posts
New operator (Can't really name it...)
Support, while you did show a workaround, four if then blocks is very annoying as it takes up way more space than one block.
In fact, I think the multiplication, division, addition, and subtraction operators should be replaced with your idea.
In fact, I think the multiplication, division, addition, and subtraction operators should be replaced with your idea.
Last edited by EatNYeet (May 10, 2021 17:19:15)
- Evanzap
-
100+ posts
New operator (Can't really name it...)
Support, the workaround is really long and would be inconvenient to make.
- 7salad3salad
-
1000+ posts
New operator (Can't really name it...)
Support! Why not add ^ too lol!
- aw3s0me8
-
24 posts
New operator (Can't really name it...)
Yeah! Something like this?
P.S. How did you get 3.0 scratchblocks???
- GAMER_6O7
-
100+ posts
New operator (Can't really name it...)
The Github scratchblocks homepageYeah! Something like this?
P.S. How did you get 3.0 scratchblocks???
- aw3s0me8
-
24 posts
New operator (Can't really name it...)
Yeah! Sure! Support! Why not add ^ too lol!
- aw3s0me8
-
24 posts
New operator (Can't really name it...)
Thanks!The Github scratchblocks homepageYeah! Something like this?
P.S. How did you get 3.0 scratchblocks???
- Cinderpelt9
-
75 posts
New operator (Can't really name it...)
Support! This could be really useful!
- scratchieguy12345678
-
500+ posts
New operator (Can't really name it...)
No support. The only application this would be useful for would be calculators. Besides, the example you described isn't even that difficult to make.
- 7salad3salad
-
1000+ posts
New operator (Can't really name it...)

Mockup of the exponent version
- aw3s0me8
-
24 posts
New operator (Can't really name it...)
I know, but it's still more work- over 10 blocks extra No support. The only application this would be useful for would be calculators. Besides, the example you described isn't even that difficult to make.
- plqaokwsijeduhrfyg
-
500+ posts
New operator (Can't really name it...)
That would make it a list and probably a duplicate. Support! Why not add ^ too lol!
- EatNYeet
-
500+ posts
New operator (Can't really name it...)
Okay, let's remove every block in Scratch that has a 10+ block workaround. No support. The only application this would be useful for would be calculators. Besides, the example you described isn't even that difficult to make.
- dertermenter
-
1000+ posts
New operator (Can't really name it...)
I think overall simplifying the math block to a dropdown is a good idea as it makes the block pallete shorter and it will have a better functionally changing between these math blocks.
- fdreerf
-
1000+ posts
New operator (Can't really name it...)
By this logic, we should add every script that is over 10 blocks long as a block. There would be infinite blocks, but hey, you don't have to do a workaround!Okay, let's remove every block in Scratch that has a 10+ block workaround. No support. The only application this would be useful for would be calculators. Besides, the example you described isn't even that difficult to make.
I don't like this because this will cause all of the operator blocks to be slightly longer:
(() + ())If you use those blocks often enough in a script (which you often will) this can cause them to become very cumbersome:
(() [+ v] () ::operators)
((((((((((((var 1) + (var 2)) + (var 3)) + (var 4)) + (var 5)) + (var 6)) + (var 7)) + (var 8)) + (var 9)) + (var 10)) + (var 11)) + (var 12))
((((((((((((var 1) [+ v] (var 2) ::operators) [+ v] (var 3) ::operators) [+ v] (var 4) ::operators) [+ v] (var 5) ::operators) [+ v] (var 6) ::operators) [+ v] (var 7) ::operators) [+ v] (var 8) ::operators) [+ v] (var 9) ::operators) [+ v] (var 10) ::operators) [+ v] (var 11) ::operators) [+ v] (var 12) ::operators)
- PkmnQ
-
1000+ posts
New operator (Can't really name it...)
Hold on, I need to update my workaround chart
- PkmnQ
-
1000+ posts
New operator (Can't really name it...)

Now suggestions like this are accounted for in the chart.
This is a simple suggestion with a complex workaround, so we go to B. There's eval, but it's unsafe, so nobody really uses that. Other than that, it's mostly just the workaround that's used. So the workaround is relevant.
- scratchieguy12345678
-
500+ posts
New operator (Can't really name it...)
Now suggestions like this are accounted for in the chart.
This is a simple suggestion with a complex workaround, so we go to B. There's eval, but it's unsafe, so nobody really uses that. Other than that, it's mostly just the workaround that's used. So the workaround is relevant.
That's a really good chart!
I understand the decision to bundle up abs, floor, ceiling, square root, sin, cos, tan, asin, acos, atan, ln, log, e^, and 10^ into one block since it was really hard to keep up with all of those functions, however, there's only 4 basic arithmetic operators and they aren't that hard to deal with.
- Discussion Forums
- » Suggestions
-
» New operator (Can't really name it...)