Discuss Scratch
- Discussion Forums
- » Suggestions
- » Boolean variables :D
- savaka
- Scratcher
1000+ posts
Boolean variables :D
Scratch will not have variable types. But there are no data types so a true boolean block is just “true” so just type that.
- MushroomMan99
- Scratcher
100+ posts
Boolean variables :D
I support!
when green flag clicked
if <(language) = [English ]> then
say [Everything is Awesome!] for (2) secs
end
if <(language) = [French ]> then
say [Tout est super-genial!] for (2) secs
end
if <(language) = [Italian ]> then
say [E meraviglioso!] for (2) secs
end
if <(language) = [Spanish ]> then
say [Todo es fabuloso!] for (2) secs
end
- jaboyc
- Scratcher
100+ posts
Boolean variables :D
YES THIS HAS BEEN SUGGESTED BEFORE!!!
I think that it would be convenient for proffesional Scratchers to use a boolean variable block. It would look like a normal variable and it would have pointy ends. People say its too complicated for new Scrathers but I think that it won't be that confusing. I see that in custom blocks, there is a boolean input so why not make boolean variables? When you click create a new variable, it would give you the default variable shape but if you click on a check box labeled “boolean”, it would become a boolean variable. Why not?
To set a boolean variable, the
It wouldn't be that hard to understand!
Let me know what you guys think!
(Why did I post this even though I know it has been suggested before? I changed the idea a bit than some other people )
I think that it would be convenient for proffesional Scratchers to use a boolean variable block. It would look like a normal variable and it would have pointy ends. People say its too complicated for new Scrathers but I think that it won't be that confusing. I see that in custom blocks, there is a boolean input so why not make boolean variables? When you click create a new variable, it would give you the default variable shape but if you click on a check box labeled “boolean”, it would become a boolean variable. Why not?
To set a boolean variable, the
set [boolean v] to []would become
set [boolean v] to <>
It wouldn't be that hard to understand!
Let me know what you guys think!
(Why did I post this even though I know it has been suggested before? I changed the idea a bit than some other people )
Last edited by jaboyc (Sept. 9, 2014 23:28:52)
Check out my amazing game, Scratch Party! I worked so hard on making this so please check it out!
if <(You are cool?)=[true]> then
say [Scratch Party is awesome!]
forever
play Scratch Party! ::custom
end
end
- gigapouch
- Scratcher
1000+ posts
Boolean variables :D
YES THIS HAS BEEN SUGGESTED BEFORE!!!
I think that it would be convenient for proffesional Scratchers to use a boolean variable block. It would look like a normal variable and it would have pointy ends. People say its too complicated for new Scrathers but I think that it won't be that confusing. I see that in custom blocks, there is a boolean input so why not make boolean variables? When you click create a new variable, it would give you the default variable shape but if you click on a check box labeled “boolean”, it would become a boolean variable. Why not?
To set a boolean variable, theset [boolean v] to []would becomeset [boolean v] to <>
It wouldn't be that hard to understand!
Let me know what you guys think!
(Why did I post this even though I know it has been suggested before? I changed the idea a bit than some other people )
Or you could just store either “false” or “true” in a normal variable and do this:
if <(booleanvar) = [true ]> then
do true scripts
else
do false scripts
I have a Steam account. If you have one too, feel free to add me to your friends list.
Also check out my YouTube channel if you like the outdoors, Minecraft, cars, roller coasters, etc.
- jaboyc
- Scratcher
100+ posts
Boolean variables :D
Yes I know. Don't you think Boolean variables would make things simpler? It would also introduce booleans to new scratchers so they could get familiar with them.
Check out my amazing game, Scratch Party! I worked so hard on making this so please check it out!
if <(You are cool?)=[true]> then
say [Scratch Party is awesome!]
forever
play Scratch Party! ::custom
end
end
- gigapouch
- Scratcher
1000+ posts
Boolean variables :D
True. No support. You can already put booleans in aset [variable v] to []and<(variable) = [true]>isn't that hard to do.
I have a Steam account. If you have one too, feel free to add me to your friends list.
Also check out my YouTube channel if you like the outdoors, Minecraft, cars, roller coasters, etc.
- Interkey
- Scratcher
78 posts
Boolean variables :D
Actually, you can use variables to function as different types of variables:
if <touching [Sprite1 v] ?> then
set [touching sprite1? v] to [true]
end
if <not <touching [Sprite1 v] ?>> then
set [touching sprite1? v] to [false]
end
Ads:One small project for Interkey, one giant leap for Interkey's coding!/Rockin' in a winter wonder land/Check out this new studio!
say [♫♫Keep on Scratchin'♫♫]
- NNNPPPBBB
- Scratcher
100+ posts
Boolean variables :D
I know… it would just make it a whole lot easier. You can just set a variable to zero or one, and check if it equals one.
support on this one. Don't forget:set [ v] to [true v]And I support.
does your word mind want a challenge? click here.
black link
Hello I am NNNPPAAAAAAAAUUUGGGHHHH MY SIGNATURE'S BEING EATEN BY A KUMQ—
{the sound of silence}
;
- photopolaraccoustic
- Scratcher
42 posts
Boolean variables :D
My variabools API is designed to make boolean as well as numeric variables! here is a link: https://scratch.mit.edu/projects/67760866/
- gdpr533f604550b2f20900645890
- Scratcher
1000+ posts
Boolean variables :D
Support! It would be a huge time saver if we could just insert a boolean variable into a hexagonal boolean slot instead of doing "<(booleanVariable) = [true]>."
Last edited by gdpr533f604550b2f20900645890 (Oct. 13, 2015 22:29:46)
- Zekrom01
- Scratcher
1000+ posts
Boolean variables :D
Do
set [ v] to [0 ] //or falseno support.
set [ v] to [1 ] //or true
20 something years old
Probably doing college work
- gdpr533f604550b2f20900645890
- Scratcher
1000+ posts
Boolean variables :D
Yay, the topic was reopened just now!
- ItchyCatIII
- Scratcher
500+ posts
Boolean variables :D
No support.
There is a very simple workaround that not too many people know:
A blank boolean slot returns “false”
And for those who have not figured that out, there is the variable method, which may be slightly annoying but not too hard to figure out or do.
There is a very simple workaround that not too many people know:
A blank boolean slot returns “false”
<not <>>without anything in it, returns true.
And for those who have not figured that out, there is the variable method, which may be slightly annoying but not too hard to figure out or do.
Don't you just hate when people advertise in their signatures (and raisin cookies that look like chocolate chip ones. That's just not okay).
#BringItBack
- gdpr533f604550b2f20900645890
- Scratcher
1000+ posts
Boolean variables :D
Can the not<> block store a value? No. In addition, doing <(variable) = > encourages bad programming practices. For a further explanation of my stance, see No support.here.
There is a very simple workaround that not too many people know:
A blank boolean slot returns “false”<not <>>without anything in it, returns true.
And for those who have not figured that out, there is the variable method, which may be slightly annoying but not too hard to figure out or do.
- savaka
- Scratcher
1000+ posts
Boolean variables :D
I made an extension that does thisCan the not<> block store a value? No. In addition, doing <(variable) = > encourages bad programming practices. For a further explanation of my stance, see No support.here.
There is a very simple workaround that not too many people know:
A blank boolean slot returns “false”<not <>>without anything in it, returns true.
And for those who have not figured that out, there is the variable method, which may be slightly annoying but not too hard to figure out or do.
- Zekrom01
- Scratcher
1000+ posts
Boolean variables :D
<offtopic>Scratch is NOT encouraging bad practices. They are making it so students can get ready to do actual coding stuff.Can the not<> block store a value? No. In addition, doing <(variable) = > encourages bad programming practices. For a further explanation of my stance, see No support.here.
There is a very simple workaround that not too many people know:
A blank boolean slot returns “false”<not <>>without anything in it, returns true.
And for those who have not figured that out, there is the variable method, which may be slightly annoying but not too hard to figure out or do.
Scratch is meant to get starting users on a low floor, not a high ceiling. Also, = and == can get really confusing because they mean 2 different things. And you do know people under the age of 10 use Scratch, right? .</offtopic>
Last edited by Zekrom01 (Jan. 12, 2016 23:23:39)
20 something years old
Probably doing college work
- gdpr533f604550b2f20900645890
- Scratcher
1000+ posts
Boolean variables :D
I wasn't criticizing == in my post. I was saying that Scratchers should be able to directly put a variable in a hexagonal Boolean slot instead of using the comparison operator block. What happens currently is that the Boolean value stored in the variable is casted to a String and compared to the String “true” using the <[] = []> block. Putting a variable in a Boolean slot would not be confusing, and it would actually be more convenient.<offtopic>Scratch is NOT encouraging bad practices. They are making it so students can get ready to do actual coding stuff.Can the not<> block store a value? No. In addition, doing <(variable) = > encourages bad programming practices. For a further explanation of my stance, see No support.here.
There is a very simple workaround that not too many people know:
A blank boolean slot returns “false”<not <>>without anything in it, returns true.
And for those who have not figured that out, there is the variable method, which may be slightly annoying but not too hard to figure out or do.
Scratch is meant to get starting users on a low floor, not a high ceiling. Also, = and == can get really confusing because they mean 2 different things. And you do know people under the age of 10 use Scratch, right? .</offtopic>
- Zekrom01
- Scratcher
1000+ posts
Boolean variables :D
yea, andI wasn't criticizing == in my post. I was saying that Scratchers should be able to directly put a variable in a hexagonal Boolean slot instead of using the comparison operator block. What happens currently is that the Boolean value stored in the variable is casted to a String and compared to the String “true” using the <[] = []> block. Putting a variable in a Boolean slot would not be confusing, and it would actually be more convenient.<offtopic>Scratch is NOT encouraging bad practices. They are making it so students can get ready to do actual coding stuff.Can the not<> block store a value? No. In addition, doing <(variable) = > encourages bad programming practices. For a further explanation of my stance, see No support.here.
There is a very simple workaround that not too many people know:
A blank boolean slot returns “false”<not <>>without anything in it, returns true.
And for those who have not figured that out, there is the variable method, which may be slightly annoying but not too hard to figure out or do.
Scratch is meant to get starting users on a low floor, not a high ceiling. Also, = and == can get really confusing because they mean 2 different things. And you do know people under the age of 10 use Scratch, right? .</offtopic>
<(var) = [1 ]>is just as convenient.
20 something years old
Probably doing college work
- gdpr533f604550b2f20900645890
- Scratcher
1000+ posts
Boolean variables :D
No, it isn't.yea, andI wasn't criticizing == in my post. I was saying that Scratchers should be able to directly put a variable in a hexagonal Boolean slot instead of using the comparison operator block. What happens currently is that the Boolean value stored in the variable is casted to a String and compared to the String “true” using the <[] = []> block. Putting a variable in a Boolean slot would not be confusing, and it would actually be more convenient.<offtopic>Scratch is NOT encouraging bad practices. They are making it so students can get ready to do actual coding stuff.Can the not<> block store a value? No. In addition, doing <(variable) = > encourages bad programming practices. For a further explanation of my stance, see No support.here.
There is a very simple workaround that not too many people know:
A blank boolean slot returns “false”<not <>>without anything in it, returns true.
And for those who have not figured that out, there is the variable method, which may be slightly annoying but not too hard to figure out or do.
Scratch is meant to get starting users on a low floor, not a high ceiling. Also, = and == can get really confusing because they mean 2 different things. And you do know people under the age of 10 use Scratch, right? .</offtopic><(var) = [1 ]>is just as convenient.
How to use a Variable's Boolean value:
- Click on the Operators category
- Drag the <[] = []> block into the Boolean slot
- Click the Data category
- Drag the variable you want into one operand slot of the = block
- Type “true” in the other operand slot
How you should be able to use a Boolean-typed Variable's value:
- Click on the Data category
- Drag the variable you want into the Boolean slot
- Discussion Forums
- » Suggestions
- » Boolean variables :D