Discuss Scratch

jgdoesscratch
Scratcher
29 posts

True and False boolean constants

It's very simple. Under operators, there would be two new blocks:

<true ::operators> //Always True
<false ::operators> //Always False
The usage of the workaround looks rather hard to understand, and also somewhat incomprehensible.

<[0] = [0]> //Always True
<[0] = [1]> //Always False
openPoll
Scratcher
1000+ posts

True and False boolean constants

jgdoesscratch wrote:

It's very simple. Under operators, there would be two new blocks:

<true ::operators> //Always True
<false ::operators> //Always False
The usage of the workaround looks rather hard to understand, and also somewhat incomprehensible.

<[0] = [0]> //Always True
<[0] = [1]> //Always False
No support, they are very easy to understand. Also, couldn't you just use
<not <>> //true
and
<<> and <>> //false
instead?

Moi? Whaddya wahnt from moi?

——

Inactive Scratcher • making memes wen??? • define defineI have Robux >:)1,000+ hours on Splatoon 2 • 250+ hours on Pokémon White • 100+ hours on MinecraftAn 8 bit remix I love • i have lots game • too lazy to make rainbows • still a proud Windows 7 user
-ShadowOfTheFuture-
Scratcher
1000+ posts

True and False boolean constants

In what way is the workaround you provided “hard to understand” or “incomprehensible”? Anyone with a basic understanding of numbers knows that 0 is always equal to itself, and can't be equal to 1, 2, 3, etc., and it's a simple jump from that to recreating “true” and “false” constants. I think it's very easy to understand.

<Insert uncreative signature here>









██       ██  ██            ██  ██       ██
██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██
███ ███ ██ ████ ██ ███ ███
█████████ █████ █████ █████████

“Though the seasons come and go, and sunshine turns to snow, we will always have tomorrow up ahead.”
14152cool
Scratcher
100+ posts

True and False boolean constants

half-support. The workarounds look confusing to new scratchers at first, but they still could understand why. I would personally just use “not<>” for true statements and leave it blank for false statements.
(plus, it's kindof already a thing in snap i guess)

Annoyingly, my signature was eaten by a small, white dog. How annoying.




StrangeMagic32
Scratcher
1000+ posts

True and False boolean constants

I don't get it… what would they do? an example of usage?


“Remember the worth of souls is great in the sight of God;”
- Doctrine and Covenants 18:10


I have since moved to @JollyWinter
Za-Chary
Scratcher
1000+ posts

True and False boolean constants

StrangeMagic32 wrote:

I don't get it… what would they do? an example of usage?
An example might be something like this:

set [counter v] to [0]
set [loop? v] to <true :: operators>
repeat until <(loop?) = <false :: operators>>
change [counter v] by (1)
if <(counter) > [10]> then

set [loop? v] to <false :: operators>

end
end

Using booleans like this can be standard in real computer programming — but it indeed is very easy to work around this on Scratch.

Last edited by Za-Chary (April 20, 2019 03:16:55)


This is my forum signature! On a forum post, it is okay for Scratchers to advertise in their forum signature. The signature is the stuff that shows up below the horizontal line on the post. It will show up on every post I make.

I was a Scratch Team member from May 10th 2019 to October 29th 2021.

my notebook | scratch team essay | accessibility essay
-SystemError-
Scratcher
59 posts

True and False boolean constants

Za-Chary wrote:

An example might be something like this:

set [counter v] to [0]
set [loop? v] to [false]
repeat until <(loop?) = <false :: operators>>
change [counter v] by (1)
if <(counter) > [10]> then

set [loop? v] to <false :: operators>

end
end

A workaround here - you can just type “false” or 0 instead of using a boolean reporter constant. I think that Scratch doesn't really need true and false constants, as it's already pretty very easy to workaround, although other blocks we currently have are easily workaroundable as well.

Last edited by -SystemError- (April 19, 2019 15:40:00)


-Rex-
Scratcher
500+ posts

True and False boolean constants

Za-Chary wrote:

StrangeMagic32 wrote:

I don't get it… what would they do? an example of usage?
An example might be something like this:

set [counter v] to [0]
set [loop? v] to [false]
repeat until <(loop?) = <false :: operators>>
change [counter v] by (1)
if <(counter) > [10]> then

set [loop? v] to <false :: operators>

end
end

Using booleans like this can be standard in real computer programming — but it indeed is very easy to work around this on Scratch.
Your usage doesn't make any sense because the loop would never run—the boolean false would be casted to a string when testing for equality with the initial value of “loop?”. It would make much more sense if you could simply drop variables into boolean slots—which would be more like what you would do in “real” languages.
badatprogrammingibe
Scratcher
500+ posts

True and False boolean constants

Here is a simple usage case of it:
custom block with boolean input <true :: operators> :: custom
Often I have found my self requiring something alike to this, so support.
For large scripts, using the not or or block workaround can be hard to read.
To all those that say no support because of an easy workaround, why don't we delete variables all together as they can be easily replaced by lists?

Last edited by badatprogrammingibe (April 20, 2019 02:00:49)

Za-Chary
Scratcher
1000+ posts

True and False boolean constants

-Rex- wrote:

Your usage doesn't make any sense because the loop would never run—the boolean false would be casted to a string when testing for equality with the initial value of “loop?”. It would make much more sense if you could simply drop variables into boolean slots—which would be more like what you would do in “real” languages.
Sorry, I screwed that up. I think I fixed it now. I wrote it up quickly, and it was like 8:00am when I wrote it, so I was sorta out of it.

This is my forum signature! On a forum post, it is okay for Scratchers to advertise in their forum signature. The signature is the stuff that shows up below the horizontal line on the post. It will show up on every post I make.

I was a Scratch Team member from May 10th 2019 to October 29th 2021.

my notebook | scratch team essay | accessibility essay
-Accio-
Scratcher
1000+ posts

True and False boolean constants

No support

The workarounds are extremely simple.

Hi There! I'm -Accio-


I am currently attending university for a Bachelor's of Science in Chemistry.

“If you are not part of the solution, you are part of the precipitate”
imfh
Scratcher
1000+ posts

True and False boolean constants

Weak support. As badatprogrammingibe said, although the workarounds are simple, it could improve readability.

Scratch to Pygame converter: https://scratch.mit.edu/discuss/topic/600562/
MarsCat1
Scratcher
1 post

True and False boolean constants

Methinks they are gone from scratch, because I cannot find them… Any ideas?
imfh
Scratcher
1000+ posts

True and False boolean constants

MarsCat1 wrote:

Methinks they are gone from scratch, because I cannot find them… Any ideas?
Use <not <>> for true and <<> and <>> for false. :: grey

Scratch to Pygame converter: https://scratch.mit.edu/discuss/topic/600562/
Penguin646
Scratcher
100+ posts

True and False boolean constants

Semi support. The workaround is simple, but this could be easier to understand.

Last edited by kaj (Tomorrow 15:57:42)

Moved to Peneren
That doesn't mean I'll never use this account again, just that all the stuff here will likely just be low effort.
portalpower
Scratcher
1000+ posts

True and False boolean constants

I don't see much use for it and there are easy work arounds also why would someone new to scratch want to use that anyway

thank you for reading my post and have a nice day!
shift+down to view my signature



















idk what to put here.
kkbst
Scratcher
1 post

True and False boolean constants

<[1] < [2]> i think that means true, i got it from a video: https://www.youtube.com/watch?v=lG8se0XhRbk

Last edited by kkbst (Jan. 18, 2021 19:01:35)

MDCCCLXVII
Scratcher
1000+ posts

True and False boolean constants

kkbst wrote:

<[1] < [2]>
i think that means true, i got it from a video: https://www.youtube.com/watch?v=lG8se0XhRbk
close your [scratchblocks] tags

if true and false booleans get added into scratch, then there should also be the ability to drag variable reporters into boolean slots (not a separate variable type) and if you're looking for a duplicate for these booleans, then this is the oldest that I can find.
Zoomer_X
Scratcher
500+ posts

True and False boolean constants

You could just use the not and or blocks.

The Question Mark Glitch
Sometimes in the editor, your costumes become gray question marks. If this happens, reload. If this happens, X-out the tab and DO NOT SAVE, EDIT, OR SEE INSIDE or the question mark will be permanent.
tariksissamangka
Scratcher
7 posts

True and False boolean constants


if you want more blocks check: turbowarp.org

Powered by DjangoBB