Discuss Scratch

kNoobLauch
Scratcher
100+ posts

Boolean variables :D

Hey, often when I'm working with scratch I need variables which has only two conditions, true or false.
Would be cool if there were variable type.

(Sry 4 bad english… I need a signature )

jvvg
Scratcher
1000+ posts

Boolean variables :D

You can just set a variable to zero or one, and check if it equals one.

jvvg
Administrator and backend engineer on the Scratch Wiki
Executive director of FutureSight Technologies
vacuumfan7072
Scratcher
100+ posts

Boolean variables :D

if <variable=1>
if <variable=true>

Scratching since 2010
when green flag clicked
forever
Keep Smiling, Homie
end
dvd4
Scratcher
100+ posts

Boolean variables :D

You could also just set it to “true” or “false”.

if<(i)=>
}
*block here*
}


YOU WILL REMEMBER MY NAME
kNoobLauch
Scratcher
100+ posts

Boolean variables :D

Yes, I can… but boolean variables would be also nice ._.

roijac
Scratcher
100+ posts

Boolean variables :D

kNoobLauch wrote:

Yes, I can… but boolean variables would be also nice ._.
indeed
Gego51
Scratcher
28 posts
zorket
Scratcher
500+ posts

Boolean variables :D

Lightnin already denied this because he said that it would confuse new scratchers.

Try out my new strategy/luck game: Battleship!
alexphan
Scratcher
1000+ posts

Boolean variables :D

One question: WHAT ARE BOOLEAN VARIABLES???????!?!?!?:o

Sorry, this signature was blocked by your Internet provider. To access this signature, please upgrade your service plan (from $199.99/mo)
drmcw
Scratcher
1000+ posts

Boolean variables :D

alexphan wrote:

One question: WHAT ARE BOOLEAN VARIABLES???????!?!?!?:o

A variable that can be either true or false. If it was a Scratch block it would have pointy ends.

Last edited by drmcw (June 30, 2013 06:19:21)


10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
ProdigyZeta7
Scratcher
1000+ posts

Boolean variables :D

You know, you could always put boolean in a string argument.
i.e. set boolean to <(boolean) = {false}> (instant true/false switch!)



alexphan
Scratcher
1000+ posts

Boolean variables :D

drmcw wrote:

alexphan wrote:

One question: WHAT ARE BOOLEAN VARIABLES???????!?!?!?:o

A variable that can be either true or false. If it was a Scratch block it would have pointy ends.


So that's a boolean variable?
I kind of support because they're timesavers.

There shold be a dropdown, instead of putting strings.

So the block is like this: [set to
false

Then you can put it in a boolean insert, like
if <touching boy?> or
repeat until <touching boy?>

Sorry, this signature was blocked by your Internet provider. To access this signature, please upgrade your service plan (from $199.99/mo)
JAVAProgramming
Scratcher
100+ posts

Boolean variables :D

jvvg wrote:

You can just set a variable to zero or one, and check if it equals one.
I agree with jvvg.. It's really easy to set a variable to 1,0, true, or false.

My Newest Project, Come Check It Out
Dots, On Scratch
Want to change the way we count? The Dozenal System.

“The story so far:
In the beginning the Universe was created.
This has made a lot of people very angry and been widely regarded as a bad move.”
― Douglas Adams, The Restaurant at the End of the Universe
TheScratchGuru
Scratcher
5 posts

Boolean variables :D

it would help however for organizing variables
turkey3_test
Scratcher
1000+ posts

Boolean variables :D

ProdigyZeta7 wrote:

You know, you could always put boolean in a string argument.
i.e. set boolean to <(boolean) = {false}> (instant true/false switch!)
Yeah, just do that,
set [variable v] to <touching [sprite 1 v]?> //this actually works and sets the variable to true or false based on if it's touching or not

vacuumfan7072
Scratcher
100+ posts

Boolean variables :D

forever
set [Verify v] to <loud?>
set [Verify v] to <(var)=(var2)>
set [Verify v] to <Run ANY boolean here>
end
My browser / operating system: Windows 7, Chrome 30.0.1599.101, Flash 11.9 (release 900)

Last edited by vacuumfan7072 (Oct. 26, 2013 02:24:46)


Scratching since 2010
when green flag clicked
forever
Keep Smiling, Homie
end
stevetheipad
Scratcher
500+ posts

Boolean variables :D

One of the goals of Scratch is to make it easy to use and simple to learn. Booleans are more complicated and are often used in large, complex code. Since the only people that would want booleans would be those who have more experience in programming, they would also know how to create booleans within the limitations of Scratch. This being so, it's not really a feature I'd like to see added, nor do I think the Scratch Team should spend time working on this type of featured at the moment.


i miss the old days
Cocles
Scratcher
24 posts

Boolean variables :D

stevetheipad wrote:

One of the goals of Scratch is to make it easy to use and simple to learn. Booleans are more complicated and are often used in large, complex code. Since the only people that would want booleans would be those who have more experience in programming, they would also know how to create booleans within the limitations of Scratch. This being so, it's not really a feature I'd like to see added, nor do I think the Scratch Team should spend time working on this type of featured at the moment.

Yes. Booleans are complicated. Earlier programming languages were also complicated, and no recursion or OOP were implemented into. They were not user friendly, unstructured and strongly typed, among other characteristics. But they evolved into new programming concepts and easy of use. Prehistoric BASIC, ancient LOGO and Scratch nowadays show us that we can make an easy use of complex ideas. This being the case, I do not doubt that it is possible to implement Booleans, inheritance and much more features. I, as a user, would appreciate the efforts of users and Scratch Team and I think they can afford the time and expenses. I appreciate your comment.
Diamond_Projects
Scratcher
100+ posts

Boolean variables :D

Don't forget:
set [ v] to [true v]
And I support.

Last edited by Diamond_Projects (Sept. 17, 2014 13:11:28)

3sal2
Scratcher
100+ posts

Boolean variables :D

(Not supporting)
. Easily worked around.

Th* *ui** *r*wn *ox **mps o**r the la*y **g.

My 250th post!

Powered by DjangoBB

Standard | Mobile