After experimenting with the boolean (the pointy < > blocks), I discovered something. It turns out that the pointy blocks report as booleans using the actual words true and false. For example, you could have a block that said:
<if <touching color red>=<true>>
Also, you can put booleans into say blocks and think blocks to make it easier to test these blocks. (By the way, anywhere you can add custom text you can add these boolean blocks, ie. in lists and variables)
You can also make the built in booleans equal to each other like this:
<<touching color red>=<mouse down>>
Although it doesn't make much sense, essentially what it does is compares the reported value (of true or false) to another reported value.
If not exactly sure what this does for you, but it's a very interesting thing to play with!
Offline
I knew this already. It's like that for variables too. If you double click "If variable = something," and it's true or false, it'll tell whether it's true or false.
Offline
greenflash wrote:
After experimenting with the boolean (the pointy < > blocks), I discovered something. It turns out that the pointy blocks report as booleans using the actual words true and false. For example, you could have a block that said:
<if <touching color red>=<true>>
...If not exactly sure what this does for you, but it's a very interesting thing to play with!![]()
Sure enough Cat knew whether it was touching a black oval in a quick new project, and said as much!
And then if it was true that Cat was touching the black oval, Cat played the sound "Meow."
A whole new dimension of Scratch to contemplate!
Thanks!!
Offline
Interesting... I wonder if you can do any other neat things with these blocks.
Offline
Larry828 wrote:
greenflash wrote:
After experimenting with the boolean (the pointy < > blocks), I discovered something. It turns out that the pointy blocks report as booleans using the actual words true and false. For example, you could have a block that said:
<if <touching color red>=<true>>
...If not exactly sure what this does for you, but it's a very interesting thing to play with!![]()
Sure enough Cat knew whether it was touching a black oval in a quick new project, and said as much!
And then if it was true that Cat was touching the black oval, Cat played the sound "Meow."
A whole new dimension of Scratch to contemplate!
Thanks!!![]()
If kind of redundant if you use if <>=true. You can use the not block instead of false. But what I like the most is seeing if two values are the same, if they are true/true and false/false.
I just tried using the booleans with the > block instead of =. It turns out that truth is greater than falseness!
Edit: I bet we could figure out how to detect all the combinations of true/false for two booleans. Using the > you can determine "true, false" and using < you can detect "false, true"
Last edited by greenflash (2010-02-21 22:34:40)
Offline
Another weird discovery: on variables, true is true and false is false, but on lists, true is 1 and false is 0. Weird discrepancy... But I guess that explains why true>false
Offline
What, you mean nobody's discovered this before? o.O
I found this like a week after I started using scratch.
Offline
I knew that...
greenflash wrote:
Another weird discovery: on variables, true is true and false is false, but on lists, true is 1 and false is 0. Weird discrepancy... But I guess that explains why true>false
...But not this
Offline
I knida knew this, i just wouldn't have been able to put it into words.
Offline
Larry828 wrote:
markyparky56 wrote:
I knida knew this, i just wouldn't have been able to put it into words.
And I could have put it into words, but I didn't know anything about it.
Yet you knew nothing about it, so the subject of what you were putting into words would have been nothing, so it would be nothing.
Offline