A new Reporter block that makes 0 or 1
so
<Report of <[haystack v] contains [needle]>>would report 1 if the list haystack contained needle and 0 if the list haystack didn't have a item called needle.
Last edited by Martiscratch (2012-09-29 08:27:32)
Offline
Why can't you just use the built-in booleans
Offline
RedRocker227 wrote:
Why can't you just use the built-in booleans
because those report string data, not numbers. this block could be used to include booleans in calculations without the need for an intermediate variable and if else statement to translate the "true" or "false" into "1" or "0"
support
Offline
the block (not in code) is
( report of < >) not <report of < >>
Offline
A boolean to binary might be useful...
Offline
that is what the block is
(btw.bump)
Offline
if <whatever boolean> set [return v] to [1] else set [return v] to [0] endSeems simple enough to me. Don't support. How would you use it anyway?
Offline
put it into scripts in the place of ( )
Offline
Gravitation wrote:
Seems simple enough to me. Don't support. How would you use it anyway?
see my above post #4
Offline
Wes64 wrote:
RedRocker227 wrote:
Why can't you just use the built-in booleans
because those report string data, not numbers. this block could be used to include booleans in calculations without the need for an intermediate variable and if else statement to translate the "true" or "false" into "1" or "0"
support
Good point
(Also, above post, I never even noticed the posts had numbers haha)
Offline