Discuss Scratch
- Discussion Forums
- » Suggestions
- » Boolean variables :D
- medians
-
1000+ posts
Boolean variables :D
Did you even look at the id of that project or the time of that post?? The project isn't even shared anymore.http://scratch.mit.edu/projects/10841526/Don't advertise
https://scratch.mit.edu/discuss/post/60427/
- usefun
-
1000+ posts
Boolean variables :D
deleted
Last edited by usefun (Jan. 11, 2024 04:35:27)
- mjc9576
-
3 posts
Boolean variables :D
i know how to do constants which could be similar to what you want.
for a false constant use something like
for a false constant use something like
if <[1] = [0]> thenand for a true constant use something like
say [ur code]
end
if <[1] = [1]> then
say [ur code]
end
- starlightsparker
-
1000+ posts
Boolean variables :D
A lot of things would be nice but if there’s an easy workaround really what’s the point? Yes, I can… but boolean variables would be also nice ._.
- Malicondi
-
1000+ posts
Boolean variables :D
<boolean variable ::variables>cool idea, but i think it might be a little annoying, and you can always set a variable to 0 or 1
but, if this allowed us to add a boolean that doesn't exist, that would be extremely helpful
- xXRedTheCoderXx
-
1000+ posts
Boolean variables :D
I think this would go great with a new toggle block, too.
but in Scratch you'd have to do something like,
toggle boolean [foo v] :: variablesIn other programming languages, you can do something like
foo = !foo;
if <(foo) = [true]> thenso a toggle block would save time and make code cleaner / more compact. So would this suggestion in general, as you'd be able to do just
set [foo v] to [false]
else
set [foo v] to [true]
end
or::grey
set [foo v] to <not <(foo) = [true]>>
if <foo::variables> thenLook how much more readable that is!
...::grey
end
as opposed to::grey
if <(foo)=[true]> then
...::grey
end
Last edited by xXRedTheCoderXx (March 3, 2024 03:41:47)
- mjc9576
-
3 posts
Boolean variables :D
first one sets boolean variable, second one is to type “true” or “false” to easily choose which value to set your boolean variable to
set <> to <>
<[]>
- cookieclickerer33
-
1000+ posts
Boolean variables :D
A lot of things would be nice but if there’s an easy workaround really what’s the point? Yes, I can… but boolean variables would be also nice ._.
Just like with
<[] < []>It’s to make it faster to program things, you could just use the opposite inputs on the greater than block.
It’s similar with
change [var v] by (1)You can just do this
set [var v] to ((var) + (1)But it’s easier to use change by than it is to use set.
why do we have
say [] for (2) secs
think [] for (2) secs
When you can just do this
define say (thing) for (time) secs
say (thing::custom)
wait (time::custom) secs
say []
Last edited by cookieclickerer33 (March 11, 2024 11:30:52)
- cookieclickerer33
-
1000+ posts
Boolean variables :D
Y’all seem to be overthinking this, all they need to do is allow us to do this
They already do this with
if (var) thenThis would work perfectly fine and is only a few lines of code to change. I would know because I’ve done it before. It accepts the string “true” the Boolean “true” (yes they are different things) and the number and string “1”
end
They already do this with
if (item ( v) of [list v] :: list) thenBeing allowed (for some reason we can only begin to comprehend) so just let variables do the same.
end
Last edited by cookieclickerer33 (March 11, 2024 11:34:11)
- generalbrock2014
-
7 posts
Boolean variables :D
WELCOME TO THE SCRATCH 4.0 BLOCKS AND TODAY WE'RE GONNA MAKE BLOCKS INCLUDING YOU. Lets do some EXAMPLES!!!!!!!!!!!
Example #1 to #5 (motion)
I
I
I
v
SCRATCH 4.0 IS COMING IN 2025!!!
Example #1 to #5 (motion)
I
I
I
v
touching x:()y:()? :: motion boolean // if sprite is touching the x and the y position of the sprite then it will report true else it will report false
if touching[edge v], bounce :: motion // if this sprite is touching something then it will bounce
point towards x:()y:() :: motion // it will point towards x and y
[sprite v] follow [sprite2 v] :: motion // the sprite will follow a another sprite
set[x v]to() :: motion // sets it into x or y
SCRATCH 4.0 IS COMING IN 2025!!!
Last edited by generalbrock2014 (May 9, 2024 15:57:22)
- BigNate469
-
1000+ posts
Boolean variables :D
There is no evidence that Scratch 4.0 is coming out, ever. WELCOME TO THE SCRATCH 4.0 BLOCKS AND TODAY WE'RE GONNA MAKE BLOCKS INCLUDING YOU. Lets do some EXAMPLES!!!!!!!!!!!
examples #1 to # 10
I
I
I
vis pen down? :: pen boolean // r
- julmik6478
-
500+ posts
Boolean variables :D
if <variable=1>
if <variable=true>
Why you don't use forum blocks? You could also just set it to “true” or “false”.
if<(i)=>
}
*block here*
}
- Hawaiiscratcher67
-
16 posts
Boolean variables :D
You can just use
set [ v] to [1]It's as simple as that.
Last edited by Hawaiiscratcher67 (May 11, 2024 13:37:53)
- medians
-
1000+ posts
Boolean variables :D
Yes, but you cannot fit those into boolean inputs, so you have to do: You can just useset [ v] to [1]It's as simple as that.
<(var) = [1]>Anyways, bringing this topic up.
- Foldy_TPOT
-
100+ posts
Boolean variables :D
No support.
if <condition::grey> then
set [boolean variable v] to [true]
else
set [boolean variable v] to [false]
end
- Discussion Forums
- » Suggestions
-
» Boolean variables :D