Discuss Scratch

TO0601
Scratcher
54 posts

Boolean variables :D

medians wrote:

Maybe:
set (boolean var v) to (true v)

set (☁ boolean var v) to (true v)

set (boolean var v) to (false v)

set checkbox color of (boolean var v) to [#01a15b]::variables //checkboxes would represent boolean vars as a readout

<boolean var::variables>

medians wrote:

hotcrystal wrote:

Are cloud boolean variables included in this suggestion?
I feel like it would not really cause any problems, as they would only be able to have two values (less than with regular cloud variables)
Also, you could already do this with regular cloud variables
WARNING!!!
this block is not real
jmdzti_0-0
Scratcher
1000+ posts

Boolean variables :D

TO0601 wrote:

WARNING!!!
this block is not real
we can tell??

Last edited by jmdzti_0-0 (Aug. 9, 2025 09:15:52)

Brudis_cool_2-0
Scratcher
19 posts

Boolean variables :D

☁ score::variables boolean
pedro2015br
Scratcher
6 posts

Boolean variables :D

hi
Toodchop
Scratcher
100+ posts

Boolean variables :D

Semi-support, there's already an easy workaround:

<(foo) = [bar]>

But! It can be a good idea!

<my variable :: variables>

<☁ my variable ::  variables>

set [my variable v] to [true v]
AceCoderClaws
Scratcher
51 posts

Boolean variables :D

I don't feel like a specifically boolean-type of variable is necessary. Why not just make it so you can put a variable into a conditional statement? If the value is a couple of specific binary values (true/false, 1/0, on/off, yes/no) would be treated as a boolean, otherwise it would just check for if the variable's value isn't empty like in other sorts of languages.

if (foo) then
say [True!]
end

if (foo) {
    console.log("True!");
}
medians
Scratcher
1000+ posts

Boolean variables :D

TO0601 wrote:

WARNING!!!
this block is not real
Yeah, it was intended as a mockup for this suggestion
redspacecat
Scratcher
500+ posts

Boolean variables :D

AceCoderClaws wrote:

I don't feel like a specifically boolean-type of variable is necessary. Why not just make it so you can put a variable into a conditional statement? If the value is a couple of specific binary values (true/false, 1/0, on/off, yes/no) would be treated as a boolean, otherwise it would just check for if the variable's value isn't empty like in other sorts of languages.

if (foo) then
say [True!]
end

if (foo) {
    console.log("True!");
}
I support this, it would be a huge timesaver. Right now only
(item () of [list v] :: list)
(item # of [] in [list v])
can go in boolean inputs and it would be nice if they all could. Booleans can already fit in round inputs, so why not the other way around?
secretuch
Scratcher
100+ posts

Boolean variables :D

Gego51 wrote:

http://scratch.mit.edu/projects/10841526/
The project doesn’t exist
Don’t advertise
redspacecat
Scratcher
500+ posts

Boolean variables :D

secretuch wrote:

Gego51 wrote:

http://scratch.mit.edu/projects/10841526/
The project doesn’t exist
Don’t advertise
That post was made 12 years ago, do you think the poster will still be active?
The project was made a really long time ago, it probably got unshared later.

Checking the project's thumbnail, it is, in fact related to boolean variables.
rdococ
Scratcher
1000+ posts

Boolean variables :D

Any new feature must be weighed against the cognitive load it puts on newcomers trying the editor for the first time. At least, that's how the Scratch Team sees it, and it's why a lot of convenient but kind of unnecessary features like this don't make it in.

Last edited by rdococ (Aug. 20, 2025 19:44:53)

lapisi
Scratcher
1000+ posts

Boolean variables :D

rdococ wrote:

(#391)
Any new feature must be weighed against the cognitive load it puts on newcomers trying the editor for the first time. At least, that's how the Scratch Team sees it, and it's why a lot of convenient but kind of unnecessary features like this don't make it in.
if they understand booleans and variables they'll be able to understand boolean variables
secretuch
Scratcher
100+ posts

Boolean variables :D

lapisi wrote:

rdococ wrote:

(#391)
Any new feature must be weighed against the cognitive load it puts on newcomers trying the editor for the first time. At least, that's how the Scratch Team sees it, and it's why a lot of convenient but kind of unnecessary features like this don't make it in.
if they understand booleans and variables they'll be able to understand boolean variables
Large type…
Bread eggs, breaded eggs?
--js--Developer--
Scratcher
11 posts

Boolean variables :D

Use hacked blocks.
AceCoderClaws
Scratcher
51 posts

Boolean variables :D

--js--Developer-- wrote:

Use hacked blocks.
The majority of users don't know how to do this. It would be a lot simpler for something like what I mentioned above to be implemented.
lapisi
Scratcher
1000+ posts

Boolean variables :D

secretuch wrote:

(#393)

lapisi wrote:

rdococ wrote:

(#391)
Any new feature must be weighed against the cognitive load it puts on newcomers trying the editor for the first time. At least, that's how the Scratch Team sees it, and it's why a lot of convenient but kind of unnecessary features like this don't make it in.
if they understand booleans and variables they'll be able to understand boolean variables
Large type…
Bread eggs, breaded eggs?
TV Tropes reference, can't link the actual TV Tropes article so I just typed the name into large-type.com, the short description of the trope is “'Thing A, Thing B, Thing A+B', though it can be longer.”
[/offtopic]

Last edited by lapisi (Aug. 21, 2025 19:49:20)

CodeComet6161
Scratcher
1000+ posts

Boolean variables :D

bump
CodeComet6161
Scratcher
1000+ posts

Boolean variables :D

bump
CodeComet6161
Scratcher
1000+ posts

Boolean variables :D

bump
medians
Scratcher
1000+ posts

Boolean variables :D

redspacecat wrote:

I feel like for the switch () block (not saying you made it), you could just do:
set [bool v] to <not <bool::variables>>

Powered by DjangoBB