Discuss Scratch

BoyoolHarita
Scratcher
100+ posts

Operators Changes

By adding an extra slot to the existing dropdown operators block and moving addition, multiplication, division and subtraction to it, this would allow Scratchers to more easily fix errors involving using the wrong operation.

For example, let's say you put this…
if <([5] + (my variable)) = (target)> then
. . . ::grey
end
… but meant for it to be multiplication. As it is, now, you'd have to manually remove the addition, put the multiplication in, and then replace the variables to create this…
if  <([5] * (my variable)) = (target)> then
. . . ::grey
end
However, with a merged operators block, it would be as simple as clicking a dropdown menu and then clicking the desired operation to fix a problem, which would significantly speed up the bug fixing process, so this…
if <([5] [+ v] (my variable) ::operators) = (target)> then
. . . ::grey
end
…can easily turn to this…
if <([5] [* v] (my variable) ::operators) = (target)> then
. . . ::grey
end
Merging the boolean operators could also be helpful along with the addition of >= and <=. This would also compress the Operators list to this (except greener):
([] [+ v] [] ::operators)
<[] [= v] [] ::operators>
<[] [and v] [] ::operators>
<not []>
(not ) would still be separate due to its nature of only having one side. This would significantly improve bug fixing as issues involving operators would be far easier to fix.
As for the (round) block, it would allow it to round to the nearest multiple of the first number, (e.g. (5 round 13) would produce 15).

(Yeah I don't know how to properly change the operators' colors )

Last edited by BoyoolHarita (Oct. 31, 2023 15:06:20)

Zydrolic
Scratcher
1000+ posts

Operators Changes

Pretty sure I've seen a discussion like this but can't find it anymore

BoyoolHarita wrote:

(#1)
(Yeah I don't know how to properly change the operators' colors )
:: (block section)
eg
:: operators
would color it the same color as an operator, you can also use hex code (note that words of color (eg “blue”) will not color it)
so in your case the blocks would be
[] [+ v] [] :: operators :: reporter // :: reporter added for shape (otherwise broken)
[] [= v] [] :: operators :: boolean // :: boolean added for shape (otherwise broken)
[] [and v] [] :: operators :: boolean // same as above
not [] :: operators :: boolean // up twice

EDIT: Forgot to mention, but have this scratch wiki page that gives all the syntaxes

Last edited by Zydrolic (Oct. 31, 2023 14:19:47)

BoyoolHarita
Scratcher
100+ posts

Operators Changes

Thank you!
Zydrolic
Scratcher
1000+ posts

Operators Changes

BoyoolHarita wrote:

(#3)
Thank you!
np
BoyoolHarita
Scratcher
100+ posts

Operators Changes

bumping this because I feel like most people just ended up missing this
MagicCoder330
Scratcher
1000+ posts

Operators Changes

I agree, would make it easier to fix the things. Also, maybe there should be an option to disable the other ones appearing, so just one of them appears in the block palate and you can just use the dropdown.
medians
Scratcher
1000+ posts

Operators Changes

There was a feature in 2.0 and 1.x that would work kinda like this, when you right clicked some operator blocks, like the addition block, it would allow you to change it to another block. Yea I use that feature a lot:


Edit:
https://scratch.mit.edu/discuss/topic/336102/
Edit 2:
This also worked on lists and vars, which you can still do:

Last edited by medians (Nov. 7, 2023 23:44:40)

BoyoolHarita
Scratcher
100+ posts

Operators Changes

medians wrote:

There was a feature in 2.0 and 1.x that would work kinda like this, when you right clicked some operator blocks, like the addition block, it would allow you to change it to another block. Yea I use that feature a lot:


Edit:
https://scratch.mit.edu/discuss/topic/336102/
Edit 2:
This also worked on lists and vars, which you can still do:

I'm not entirely sure why they removed that (honestly I didn't know that was a thing), maybe an engine change? Regardless, this would definitely be a doable way to do things seeing how it already exists in a way with
([10 ^ v] () ::operators)

Last edited by BoyoolHarita (Nov. 8, 2023 15:12:40)

Zydrolic
Scratcher
1000+ posts

Operators Changes

BoyoolHarita wrote:

(#8)
I'm not entirely sure why they removed that (honestly I didn't know that was a thing), maybe an engine change?
[1.x through 2.x were made with Squeak/SmallTalk.]
cookieclickerer33
Scratcher
1000+ posts

Operators Changes

I don’t think we should have blocks that are made entirely of inputs

It would be really hard to test the values they return because there’s nowhere to click

And it would be very very hard to represent in syntax

It would be <()()()> as the block syntax
medians
Scratcher
1000+ posts

Operators Changes

Zydrolic wrote:

BoyoolHarita wrote:

(#8)
I'm not entirely sure why they removed that (honestly I didn't know that was a thing), maybe an engine change?
[1.x through 2.x were made with Squeak/SmallTalk.]
2.0 used Flash though.
Zydrolic
Scratcher
1000+ posts

Operators Changes

medians wrote:

(#11)
2.0 used Flash though.
[Oh no.]
PaperMarioFan2022
Scratcher
1000+ posts

Operators Changes

Zydrolic wrote:

medians wrote:

(#11)
2.0 used Flash though.
[Oh no.]
No worries. Just convert 2.0 from Flash to HTML5 or something better.
cookieclickerer33
Scratcher
1000+ posts

Operators Changes

cookieclickerer33 wrote:

I don’t think we should have blocks that are made entirely of inputs

It would be really hard to test the values they return because there’s nowhere to click

And it would be very very hard to represent in syntax

It would be <()()()> as the block syntax
INSERT-USER_NAME
Scratcher
1000+ posts

Operators Changes

cookieclickerer33 wrote:

I don’t think we should have blocks that are made entirely of inputs

It would be really hard to test the values they return because there’s nowhere to click

And it would be very very hard to represent in syntax

It would be <()()()> as the block syntax
(join ((34.5) [* v] (2)::operators) [])
-Expo
Scratcher
1000+ posts

Operators Changes

BoyoolHarita wrote:

medians wrote:

There was a feature in 2.0 and 1.x that would work kinda like this, when you right clicked some operator blocks, like the addition block, it would allow you to change it to another block. Yea I use that feature a lot:


Edit:
https://scratch.mit.edu/discuss/topic/336102/
Edit 2:
This also worked on lists and vars, which you can still do:

I'm not entirely sure why they removed that (honestly I didn't know that was a thing), maybe an engine change? Regardless, this would definitely be a doable way to do things seeing how it already exists in a way with
([10 ^ v] () ::operators)

I remember myself using this years ago. If this were to get reimplemented, I'd support.
cookieclickerer33
Scratcher
1000+ posts

Operators Changes

INSERT-USER_NAME wrote:

cookieclickerer33 wrote:

I don’t think we should have blocks that are made entirely of inputs

It would be really hard to test the values they return because there’s nowhere to click

And it would be very very hard to represent in syntax

It would be <()()()> as the block syntax
(join ((34.5) [* v] (2)::operators) [])
That returns a string not a number (there is a difference) and just no, you shouldn’t have to use the join block to see what 5 + 2 is
BoyoolHarita
Scratcher
100+ posts

Operators Changes

bump

but with all the styles!

Powered by DjangoBB