Booleans as values

Since I programmed in TI-BASIC (the language Texas Instruments calculators use) before coming to SNAP!, I was wondering if you can use a Boolean as a value, since you do that often there. It turns out you can! What I mean by this is that you can use a < true > like a one in calculations, and a < false > like a zero.
untitled script pic (4)
Another thing you can do is write a block that finds the minimum of two values like this:
untitled script pic (3)
I was exited to see that this is actually a feature in SNAP!. Share what you've done with this below.

P.S. If you have a TI calculator and want to learn more about TI-BASIC (or the more advanced ICE, AXE, and Assembly), check out TI-BASIC Developer and Cemetech.

It's not exactly a feature; it's a result of the fact that Jens doesn't like checking for domain errors, because the check slows down the running of the program. So our official position is that Booleans aren't numbers, and vice versa, and if you take advantage of breaking a domain barrier it's at your own risk.But basically our scalar values behave just like the underlying Javascript values, and it's not very likely that the behavior you're seeing would change.

That's a cute min function!

I'm afraid I'm an HP calculator person. RPN FTW!

You mean like a one in calculations


Or this:
untitled script pic (2)

Nice! I never thought about using them in a list like that.

Oh, that's beautiful!