This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-09-28 14:32:24

Martiscratch
Scratcher
Registered: 2012-05-04
Posts: 100+

report of <>

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.
I hope I get supporters!
(in insanity 1.1 you can do this with the ([]) block'but I am talking anout 2.0)

Last edited by Martiscratch (2012-09-29 08:27:32)


http://signaturecraft.us/signatures/eJw1yDEOgCAMBdC9p_gnICphdnA18QwoNZIAJRTD9Z184-uP74gKjxIvxi3tzaii3ZA-PjPijdgxvBpjcCYeeOtKW2Ou3OhIAbuUIOUvpdnNtDhH1tL0AQVCHgk~.png

Offline

 

#2 2012-09-28 14:36:19

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: report of <>

Why can't you just use the built-in booleans


Why

Offline

 

#3 2012-09-28 14:41:50

dvd4
Scratcher
Registered: 2010-06-30
Posts: 1000+

Re: report of <>

RedRocker227 wrote:

Why can't you just use the built-in booleans

[/agree]


I made a mod  big_smile  It's called blook!
http://i49.tinypic.com/16ia63p.png

Offline

 

#4 2012-09-28 17:49:18

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: report of <>

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


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#5 2012-09-29 08:22:26

Martiscratch
Scratcher
Registered: 2012-05-04
Posts: 100+

Re: report of <>

the block (not in code) is
( report of < >) not <report of < >>


http://signaturecraft.us/signatures/eJw1yDEOgCAMBdC9p_gnICphdnA18QwoNZIAJRTD9Z184-uP74gKjxIvxi3tzaii3ZA-PjPijdgxvBpjcCYeeOtKW2Ou3OhIAbuUIOUvpdnNtDhH1tL0AQVCHgk~.png

Offline

 

#6 2012-09-29 15:31:06

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: report of <>

A boolean to binary might be useful...

Offline

 

#7 2012-10-04 05:49:35

Martiscratch
Scratcher
Registered: 2012-05-04
Posts: 100+

Re: report of <>

that is what the block is
(btw.bump)


http://signaturecraft.us/signatures/eJw1yDEOgCAMBdC9p_gnICphdnA18QwoNZIAJRTD9Z184-uP74gKjxIvxi3tzaii3ZA-PjPijdgxvBpjcCYeeOtKW2Ou3OhIAbuUIOUvpdnNtDhH1tL0AQVCHgk~.png

Offline

 

#8 2012-10-04 06:35:26

Gravitation
New Scratcher
Registered: 2012-09-26
Posts: 500+

Re: report of <>

if <whatever boolean>
 set [return v] to [1]
else
 set [return v] to [0]
end
Seems simple enough to me. Don't support. How would you use it anyway?

Offline

 

#9 2012-10-04 07:44:50

Martiscratch
Scratcher
Registered: 2012-05-04
Posts: 100+

Re: report of <>

put it into scripts in the place of ( )


http://signaturecraft.us/signatures/eJw1yDEOgCAMBdC9p_gnICphdnA18QwoNZIAJRTD9Z184-uP74gKjxIvxi3tzaii3ZA-PjPijdgxvBpjcCYeeOtKW2Ou3OhIAbuUIOUvpdnNtDhH1tL0AQVCHgk~.png

Offline

 

#10 2012-10-05 16:54:32

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: report of <>

Gravitation wrote:

Seems simple enough to me. Don't support. How would you use it anyway?

see my above post #4


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#11 2012-10-05 18:13:55

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: report of <>

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)


Why

Offline

 

Board footer