Boolean Behaviour in Scratch -quick demo

Game Introduction

Just a little demo that Scratch really does consider boolean values true & false to be equivalent, numerically, to values 1 and 0. Now, the interesting part is that boolean true and false are also considered equal to text strings "true" and "false", BUT text "true" and "false" are NOT equivalent to one and zero. So we have the paradoxical: 1 = true = "true", but 1 ≠ "true" That means you have to get boolean true value from a REAL boolean expression, not typed as text string "true", if you want it to behave as numerical value 1 in a mathematical expression. However, since ANY non-numerical text string is treated as value zero in a mathematical expression, text string "false" will work fine for zero – but so will "true"!! Also, note that phosphorus behaves in a different way: http://phosphorus.github.io/#108360618

How To Play

Author

TheLogFather

Category

Game Information

Game Popularity

994 views

Collection Count

41 favorites