Discuss Scratch

DarkXSeries7
Scratcher
100+ posts

color coded variables

So people can color code them based on what they should be (e.g. if you want to remember a variable is a boolean, make it red)
musicROCKS013
Scratcher
1000+ posts

color coded variables

How would you change the variable color? Could you right click to do so, or what?

Also, is there something in place where if someone makes a variable too light the text color will automatically switch to black? If so, how bright would that be?
DarkXSeries7
Scratcher
100+ posts

color coded variables

musicROCKS013 wrote:

How would you change the variable color? Could you right click to do so, or what?

Also, is there something in place where if someone makes a variable too light the text color will automatically switch to black? If so, how bright would that be?
as soon as the contrast is less than 20% ig?
and yes probably a dropdown like with “when touching color”
banana439monkey
Scratcher
1000+ posts

color coded variables

what is a boolean?
i'm serious
in javascript, a boolean will either return true or false
you can create your own, else how would you be able to really write decent javascript?
that said, because of scratch's appeal to children, typing is extremely loose
we do truly want custom reporters and booleans! they would mean the world to us
sadly the above has to be implemented using the workaround, setting a variable to “true” or “false”.
to scratch, a variable is a string (unless incremented but eurgh)
true and false are of different types
and because users set variables to “true” or “false”, those are strings.
“true” != true
as with false, “false” != false
not even loosely the same
i don't know if scratch uses strict or loose equalities with 0 and 1
technically, the following:
0 == false
0 !== false
1 == true
-1 == true
1 !== true
-1 !== true

what i'm saying here is it's just not possible because users will report strings into variables. even if they report 0 or 1, does scratch allow the user to equate them to true or false? i mean after all, unlike javascript, you can't enter a value as a boolean to even see if it exists. the problem is also exacerbated by the fact that a variable can be set to any old value throughout the runtime of the project. it is just not possible with the way scratch is currently architected, at least not without some major reconstruction within the editor and under the hood. even if all of that, it would end up being unintuitive to scratch's target audience

Banana
DarkXSeries7
Scratcher
100+ posts

color coded variables

banana439monkey wrote:

what is a boolean?
i'm serious
in javascript, a boolean will either return true or false
you can create your own, else how would you be able to really write decent javascript?
that said, because of scratch's appeal to children, typing is extremely loose
we do truly want custom reporters and booleans! they would mean the world to us
sadly the above has to be implemented using the workaround, setting a variable to “true” or “false”.
to scratch, a variable is a string (unless incremented but eurgh)
true and false are of different types
and because users set variables to “true” or “false”, those are strings.
“true” != true
as with false, “false” != false
not even loosely the same
i don't know if scratch uses strict or loose equalities with 0 and 1
technically, the following:
0 == false
0 !== false
1 == true
-1 == true
1 !== true
-1 !== true

what i'm saying here is it's just not possible because users will report strings into variables. even if they report 0 or 1, does scratch allow the user to equate them to true or false? i mean after all, unlike javascript, you can't enter a value as a boolean to even see if it exists. the problem is also exacerbated by the fact that a variable can be set to any old value throughout the runtime of the project. it is just not possible with the way scratch is currently architected, at least not without some major reconstruction within the editor and under the hood. even if all of that, it would end up being unintuitive to scratch's target audience

Banana
1 or 0
banana439monkey
Scratcher
1000+ posts

color coded variables

DarkXSeries7 wrote:

banana439monkey wrote:

what is a boolean?
i'm serious
in javascript, a boolean will either return true or false
you can create your own, else how would you be able to really write decent javascript?
that said, because of scratch's appeal to children, typing is extremely loose
we do truly want custom reporters and booleans! they would mean the world to us
sadly the above has to be implemented using the workaround, setting a variable to “true” or “false”.
to scratch, a variable is a string (unless incremented but eurgh)
true and false are of different types
and because users set variables to “true” or “false”, those are strings.
“true” != true
as with false, “false” != false
not even loosely the same
i don't know if scratch uses strict or loose equalities with 0 and 1
technically, the following:
0 == false
0 !== false
1 == true
-1 == true
1 !== true
-1 !== true

what i'm saying here is it's just not possible because users will report strings into variables. even if they report 0 or 1, does scratch allow the user to equate them to true or false? i mean after all, unlike javascript, you can't enter a value as a boolean to even see if it exists. the problem is also exacerbated by the fact that a variable can be set to any old value throughout the runtime of the project. it is just not possible with the way scratch is currently architected, at least not without some major reconstruction within the editor and under the hood. even if all of that, it would end up being unintuitive to scratch's target audience

Banana
1 or 0
ok well in that case
how does scratch know that it's a boolean? what if a user sets the boolean in the project's initialisation and not manually? what if they don't use 0 or 1? what if 0/1 becomes a score? the default for a variable is 0 so would it automatically be detected as a boolean? having scratch change variables on the fly might also mean that block colours change throughout the project, that looks completely janky and highly confusing

Banana
musicROCKS013
Scratcher
1000+ posts

color coded variables

banana439monkey wrote:

-snip-

I think you're questioning the wrong aspect of this suggestion and kind of going off topic…
DarkXSeries7
Scratcher
100+ posts

color coded variables

banana439monkey wrote:

DarkXSeries7 wrote:

banana439monkey wrote:

what is a boolean?
i'm serious
in javascript, a boolean will either return true or false
you can create your own, else how would you be able to really write decent javascript?
that said, because of scratch's appeal to children, typing is extremely loose
we do truly want custom reporters and booleans! they would mean the world to us
sadly the above has to be implemented using the workaround, setting a variable to “true” or “false”.
to scratch, a variable is a string (unless incremented but eurgh)
true and false are of different types
and because users set variables to “true” or “false”, those are strings.
“true” != true
as with false, “false” != false
not even loosely the same
i don't know if scratch uses strict or loose equalities with 0 and 1
technically, the following:
0 == false
0 !== false
1 == true
-1 == true
1 !== true
-1 !== true

what i'm saying here is it's just not possible because users will report strings into variables. even if they report 0 or 1, does scratch allow the user to equate them to true or false? i mean after all, unlike javascript, you can't enter a value as a boolean to even see if it exists. the problem is also exacerbated by the fact that a variable can be set to any old value throughout the runtime of the project. it is just not possible with the way scratch is currently architected, at least not without some major reconstruction within the editor and under the hood. even if all of that, it would end up being unintuitive to scratch's target audience

Banana
1 or 0
ok well in that case
how does scratch know that it's a boolean? what if a user sets the boolean in the project's initialisation and not manually? what if they don't use 0 or 1? what if 0/1 becomes a score? the default for a variable is 0 so would it automatically be detected as a boolean? having scratch change variables on the fly might also mean that block colours change throughout the project, that looks completely janky and highly confusing

Banana
dude it doesent do anything it just color codes it do you honestly think 8 year olds are expected to know all variable types

Last edited by DarkXSeries7 (Aug. 2, 2022 21:20:17)

banana439monkey
Scratcher
1000+ posts

color coded variables

musicROCKS013 wrote:

banana439monkey wrote:

-snip-

I think you're questioning the wrong aspect of this suggestion and kind of going off topic…
this isn’t offtopic, this is theorising the mechanic of how the feature would work
#8, see this post too

Banana
musicROCKS013
Scratcher
1000+ posts

color coded variables

banana439monkey wrote:

this is theorising the mechanic of how the feature would work
I'm pretty sure what they meant is this, “If you have a variable that you want to store 0 or 1 in, you can make it red.”

banana439monkey wrote:

this isn’t offtopic
This isn't suggesting boolean variables, it is suggesting that you can change the color of variables, so it is offtopic, right?

Color coding is a use they will have. Changing the variable colors is the actual suggestion.
banana439monkey
Scratcher
1000+ posts

color coded variables

musicROCKS013 wrote:

banana439monkey wrote:

this is theorising the mechanic of how the feature would work
I'm pretty sure what they meant is this, “If you have a variable that you want to store 0 or 1 in, you can make it red.”

banana439monkey wrote:

this isn’t offtopic
This isn't suggesting boolean variables, it is suggesting that you can change the color of variables, so it is offtopic, right?

Color coding is a use they will have. Changing the variable colors is the actual suggestion.
changing the colour of variables if they are booleans so no it is not offtopic
and how do you define whether you want to store 0 or 1 in a variable? at that point why can't we use custom reporters?

Banana
RL1123
Scratcher
1000+ posts

color coded variables

musicROCKS013 wrote:

banana439monkey wrote:

this is theorising the mechanic of how the feature would work
I'm pretty sure what they meant is this, “If you have a variable that you want to store 0 or 1 in, you can make it red.”
Yep, so basically, if the variable is used like a boolean but not actually a boolean, then color code it like that.

But I don't see the point of this. If anything, this will confuse users. You see, the colors of the blocks determine what section they are in, so it'd be confusing to have a variable that's the same color as the looks blocks and it's not in the looks section.



Currently, you can just type out the classification of your variable. For example, if it's for all sprites, USE ALL UPPERCASE. If it's for this sprite, use lowercase.
musicROCKS013
Scratcher
1000+ posts

color coded variables

banana439monkey wrote:

changing the colour of variables if they are booleans so no it is not offtopic
Here is what the OP says:

DarkXSeries7 wrote:

(e.g. if you want to remember a variable is a boolean, make it red)
This is an example of how it could be used, not the actual suggestion.

DarkXSeries7 wrote:

(e.g. if you want to remember a variable is a boolean, make it red)
This lets us assume that this is being done by the creator, and that the creator is editing the colors in accordance to how they use the variable. Variables aren't automatically changed.
DarkXSeries7
Scratcher
100+ posts

color coded variables

musicROCKS013 wrote:

banana439monkey wrote:

changing the colour of variables if they are booleans so no it is not offtopic
Here is what the OP says:

DarkXSeries7 wrote:

(e.g. if you want to remember a variable is a boolean, make it red)
This is an example of how it could be used, not the actual suggestion.

DarkXSeries7 wrote:

(e.g. if you want to remember a variable is a boolean, make it red)
This lets us assume that this is being done by the creator, and that the creator is editing the colors in accordance to how they use the variable. Variables aren't automatically changed.
yes
DarkXSeries7
Scratcher
100+ posts

color coded variables

RL1123 wrote:

musicROCKS013 wrote:

banana439monkey wrote:

this is theorising the mechanic of how the feature would work
I'm pretty sure what they meant is this, “If you have a variable that you want to store 0 or 1 in, you can make it red.”
Yep, so basically, if the variable is used like a boolean but not actually a boolean, then color code it like that.

But I don't see the point of this. If anything, this will confuse users. You see, the colors of the blocks determine what section they are in, so it'd be confusing to have a variable that's the same color as the looks blocks and it's not in the looks section.



Currently, you can just type out the classification of your variable. For example, if it's for all sprites, USE ALL UPPERCASE. If it's for this sprite, use lowercase.
maybe they could have an orange stroke? idk users change the color themselves to inform its a specific variable

but i could defo see someone looking at the source code and seeing a non variable and being confused so i thing orange strokes should work

even with ue variables can be things other than numbers and letters, which is why color coding exists in the first place there

Last edited by DarkXSeries7 (Aug. 3, 2022 14:31:27)

mitdk
Scratcher
1000+ posts

color coded variables

I feel like this might be a dupe, let me know if i'm wrong on how i'm interpreting this suggestion:
https://scratch.mit.edu/discuss/topic/516871/?page=1
musicROCKS013
Scratcher
1000+ posts

color coded variables

mitdk wrote:

I feel like this might be a dupe, let me know if i'm wrong on how i'm interpreting this suggestion:
https://scratch.mit.edu/discuss/topic/516871/?page=1
This is for changing the display color of variables, but not the color in the editor. For example:

You could change this:

foo
to look like these:
foofoofoofoo
DarkXSeries7
Scratcher
100+ posts

color coded variables

mitdk wrote:

I feel like this might be a dupe, let me know if i'm wrong on how i'm interpreting this suggestion:
https://scratch.mit.edu/discuss/topic/516871/?page=1
a bit useless, not useful for developement or gameplay
Thingied
Scratcher
1000+ posts

color coded variables

Can't you do this with prefixes? The result is basically the same.
DarkXSeries7
Scratcher
100+ posts

color coded variables

Thingied wrote:

Can't you do this with prefixes? The result is basically the same.
i guess
but humans see colors faster than characters

Powered by DjangoBB