Discuss Scratch

aw3s0me8
Scratcher
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:
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
if <(Operation)=[/]> then
set [answer v] to ((Num1)/(Num2))
end
Instead, this operator I made can really help:

 (() (+ v) ()::#5bb117) 
EXAMPLE BELOW

(Num1) //Equals 6
(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
Please try and add it / suggest it to scratch.
Thanks!

Last edited by aw3s0me8 (May 11, 2021 12:01:30)

EatNYeet
Scratcher
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.

Last edited by EatNYeet (May 10, 2021 17:19:15)

Evanzap
Scratcher
100+ posts

New operator (Can't really name it...)

Support, the workaround is really long and would be inconvenient to make.
-InsanityGames-
Scratcher
500+ posts

New operator (Can't really name it...)

Something like this?
7salad3salad
Scratcher
1000+ posts

New operator (Can't really name it...)

Support! Why not add ^ too lol!
aw3s0me8
Scratcher
24 posts

New operator (Can't really name it...)

-InsanityGames- wrote:

Something like this?
Yeah!
P.S. How did you get 3.0 scratchblocks???
GAMER_6O7
Scratcher
100+ posts

New operator (Can't really name it...)

aw3s0me8 wrote:

-InsanityGames- wrote:

Something like this?
Yeah!
P.S. How did you get 3.0 scratchblocks???
The Github scratchblocks homepage
aw3s0me8
Scratcher
24 posts

New operator (Can't really name it...)

7salad3salad wrote:

Support! Why not add ^ too lol!
Yeah! Sure!
aw3s0me8
Scratcher
24 posts

New operator (Can't really name it...)

GAMER_6O7 wrote:

aw3s0me8 wrote:

-InsanityGames- wrote:

Something like this?
Yeah!
P.S. How did you get 3.0 scratchblocks???
The Github scratchblocks homepage
Thanks!
Cinderpelt9
Scratcher
75 posts

New operator (Can't really name it...)

Support! This could be really useful!
scratchieguy12345678
Scratcher
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
Scratcher
1000+ posts

New operator (Can't really name it...)


Mockup of the exponent version
aw3s0me8
Scratcher
24 posts

New operator (Can't really name it...)

scratchieguy12345678 wrote:

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 know, but it's still more work- over 10 blocks extra
plqaokwsijeduhrfyg
Scratcher
500+ posts

New operator (Can't really name it...)

7salad3salad wrote:

Support! Why not add ^ too lol!
That would make it a list and probably a duplicate.
EatNYeet
Scratcher
500+ posts

New operator (Can't really name it...)

scratchieguy12345678 wrote:

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.
Okay, let's remove every block in Scratch that has a 10+ block workaround.
dertermenter
Scratcher
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
Scratcher
1000+ posts

New operator (Can't really name it...)

EatNYeet wrote:

scratchieguy12345678 wrote:

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.
Okay, let's remove every block in Scratch that has a 10+ block workaround.
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!

I don't like this because this will cause all of the operator blocks to be slightly longer:
(() + ())
(() [+ v] () ::operators)
If you use those blocks often enough in a script (which you often will) this can cause them to become very cumbersome:
((((((((((((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
Scratcher
1000+ posts

New operator (Can't really name it...)

Hold on, I need to update my workaround chart
PkmnQ
Scratcher
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
Scratcher
500+ posts

New operator (Can't really name it...)

PkmnQ wrote:


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.

Powered by DjangoBB