Discuss Scratch

Inreal49
Scratcher
100+ posts

Boolean variables :D

ineeded because… well…

when green flag clicked
forever

if <(moving?) = [ true]> then

move (1) steps
end

end

no support


Yes
Inreal49
Scratcher
100+ posts

Boolean variables :D

alexphan wrote:

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

well, practically boolean variables are this
<ineeded variable>


Yes
Inreal49
Scratcher
100+ posts

Boolean variables :D

Diamond_Projects wrote:

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

ineeded because
set [ v] to [ true]

lol


Yes
EliteProgramming
Scratcher
100+ posts

Boolean variables :D

no support

Easy to solve

Providing Platinum Quality Memes
Chibi-Matoran
Scratcher
1000+ posts

Boolean variables :D

EliteProgramming wrote:

no support

Easy to solve
The current situation causes bad habits when programming in other languages. “Easy to solve” doesn't justify all the reasons for the suggestion.

If you see this signature while scrolling, you have been visited by ʎ++ haskal. Lazy evaluation, monads, function purity, lambdas, currying, partial application, algebraic data types, pattern matching, and typeclasses will come to you, but only if you comment, “Thanks, ʎ++ haskal” on my profile.

Cassian && ||
pvz_pro
Scratcher
500+ posts

Boolean variables :D

no support reason: [easy workaround]
<(var)=[true]

-pvz_pro A scratcher who is retired from reading suggestions.
NEED TO SEARCH THE FORUMS? CLICK HERE!!!
A lot of emojis protect my signature
Chibi-Matoran
Scratcher
1000+ posts

Boolean variables :D

pvz_pro wrote:

no support reason: [easy workaround]
<(var)=[true]
if(x == true){}
The above is bad practice, which Scratch reinforces!

If you see this signature while scrolling, you have been visited by ʎ++ haskal. Lazy evaluation, monads, function purity, lambdas, currying, partial application, algebraic data types, pattern matching, and typeclasses will come to you, but only if you comment, “Thanks, ʎ++ haskal” on my profile.

Cassian && ||
theonlygusti
Scratcher
1000+ posts

Boolean variables :D

I think it would be nice to be able to drag variables into boolean slots, and have them be evaluated as booleans implicitly.

savaka
Scratcher
1000+ posts

Boolean variables :D

theonlygusti wrote:

I think it would be nice to be able to drag variables into boolean slots, and have them be evaluated as booleans implicitly.
sounds good
theonlygusti
Scratcher
1000+ posts

Boolean variables :D

pvz_pro wrote:

no support reason: [easy workaround]
<(var)=[true]

Inreal49 wrote:

ineeded because… well…

when green flag clicked
forever

if <(moving?) = [ true]> then

move (1) steps
end

end

no support
You guys just don't get the point of this suggestion….

This work around
  1. encourages poor programming habits
  2. is a necessity unique to Scratch
  3. is, honestly, a waste of time and energy
  4. has a higher potential for error (spelling “true” wrong, using inconsistent representations of booleans)

And, by the way:

Inreal49 wrote:

<ineeded variable>

Learn to spell unneeded, and don't be so mean.

theonlygusti
Scratcher
1000+ posts

Boolean variables :D

For the record, I support this:

theonlygusti wrote:

drag variables into boolean slots, and have them be evaluated as booleans implicitly.

Sheep_maker
Scratcher
1000+ posts

Boolean variables :D

theonlygusti wrote:

I think it would be nice to be able to drag variables into boolean slots, and have them be evaluated as booleans implicitly.
Not just variables, but for all reporters.
Support for that.

- Sheep_maker This is a kumquat-free signature. :P
This, my signature, appears below all my posts. Discuss it on my profile, not the forums. Here's how to make your own.
Post count: more than 6
.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }
Ger77
Scratcher
21 posts

Boolean variables :D

This suggestion seem logic because I do not understand why it is possible to choose “Boolean”, “Text” and “Number” in the definition of a custom block for a parameter, but not for a normal variable?
And for more confusing. You could set a normal Variable to “true” or “false” if your source is a Boolean operator
set [Next loop v] to ( (a) > (1) )  // this variable now contains  the value "true" if a is 2
set [Last loop v] to ( (a) = (3) ) // this other variable now contains the value "false" if a = 2

set [Next loop v] to ( (a) > (1) ) // this variable still contains the value "true" if a is 3
set [Last loop v] to ( (a) = (3) ) // this other variable now contains the value "true" if a = 3
Do this not make more problems to beginners instead of an existing Boolean-Typ? Such variable could have a name to describe the decision which is to make.
if  ( ( Last loop )::operators ) then
end

What do you think?

Last edited by Ger77 (April 23, 2016 22:07:31)

Scratcher1002
Scratcher
1000+ posts

Boolean variables :D

I support if I haven't. I know it is in other languages, why not Scratch?
savaka
Scratcher
1000+ posts

Boolean variables :D

Ger77 wrote:

This suggestion seem logic because I do not understand why it is possible to choose “Boolean”, “Text” and “Number” in the definition of a custom block for a parameter, but not for a normal variable?
The “Number,” “String,” and “Boolean” custom block parameters aren't accepting different data types (because Scratch has no data types), they just limit what you can input in order to make it more clear how to use the block. Number and boolean* aren't even at all necessary because all they do is limit your input to make it clear how to use the created block. Number inputs limit typed input to only numbers, and boolean inputs accept no typed input and only accept boolean reporter blocks. Since number inputs still accept all reporters, this will actually work:
define say number (number1)
say (number1) for (2) secs

say number (join [hello ] [world]) // says "hello world"
So that's why there are no data types.

Ger77 wrote:

if  <Last loop::variables> then
end
Fixed that (I think)
And this doesn't need a special variable type if reporters can just be put into boolean slots:

Sheep_maker wrote:

theonlygusti wrote:

I think it would be nice to be able to drag variables into boolean slots, and have them be evaluated as booleans implicitly.
Not just variables, but for all reporters.
Support for that.
*Actually, boolean is the only parameter that can be put in a boolean slot, but that would be fixed with theonlygusti and Sheep_maker's suggestions.
Nurutomo
Scratcher
12 posts

Boolean variables :D

when green flag clicked
forever

if <(Variable) = [true]> then

say [Place Block Here] for (0.5) secs
end

end
when green flag clicked
forever

set [Variable v] to <mouse down?>
end

Last edited by Nurutomo (May 1, 2016 02:49:24)

NanoRook
Scratcher
1000+ posts

Boolean variables :D

kNoobLauch wrote:

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

How? The workaround literally takes two seconds.

set [WaffleTastiness v] to [true ]

There's an XKCD comic for everything.













joefarebrother
Scratcher
500+ posts

Boolean variables :D

It would be a useful idea, support!

Even though the easy workaround exists, there is a chance of spelling true and false wrong, leading to bugs.

Also, I don't understand how it's confusing to beginners - we already have the “Boolean” option for custom block inputs, so Scratch does already use the word “Boolean”.


And it was delicious! Play TBGs! Check out my Scheme Interpreter!
;
Scratcher1002
Scratcher
1000+ posts

Boolean variables :D

Nurutomo wrote:

when green flag clicked
forever

if <(Variable) = [true]> then

say [Place Block Here] for (0.5) secs
end

end
when green flag clicked
forever

set [Variable v] to <mouse down?>
end
Or at that point just put the mouse down variable in the first script and delete the second script.

NanoRook wrote:

kNoobLauch wrote:

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

How? The workaround literally takes two seconds.

set [WaffleTastiness v] to [true ]
Not exactly the workaround, this too:
<(WaffleTastiness) = [true]>
agarraga
Scratcher
500+ posts

Boolean variables :D

Scratcher1002 wrote:

Nurutomo wrote:

when green flag clicked
forever

if <(Variable) = [true]> then

say [Place Block Here] for (0.5) secs
end

end
when green flag clicked
forever

set [Variable v] to <mouse down?>
end
Or at that point just put the mouse down variable in the first script and delete the second script.

NanoRook wrote:

kNoobLauch wrote:

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

How? The workaround literally takes two seconds.

set [WaffleTastiness v] to [true ]
Not exactly the workaround, this too:
<(WaffleTastiness) = [true]>
This thread is too old!

if <[Dalmatians] = [101]> then
say [I like that cartoon]
end

Powered by DjangoBB

Standard | Mobile