Discuss Scratch

crispeeweevile
New Scratcher
13 posts

a call block

i know what the my block stuff is and thats what i wanna use to just be able to call a boolean (the triangle stuff like 5 = 5 | 5 > 4 | 4 < 5 ) Thanks in advance

crisp


deck26
Scratcher
1000+ posts

a call block

Your question is unclear to me. You can put a boolean in a custom block call but it will be evaluated at the time of calling - you're passing a fixed boolean value, not a variable statement.
crispeeweevile
New Scratcher
13 posts

a call block

hmmmm yea not really sure how else i can say it
deck26
Scratcher
1000+ posts

a call block

Well what to do you want the block to do? Saying ‘the triangle stuff like …..’ may be clear to you but not those reading this. How would you use the block?
crispeeweevile
New Scratcher
13 posts

a call block

oh i want it to be able to say something like (im bad with using the scratch blocks in any comment/forum so ye)

5>4answer=54>5

(im an expert at math lol)
deck26
Scratcher
1000+ posts

a call block

Still unclear. Do you mean you want the block to say if something is true or false? Or you want it to receive two parameters and say which is biggest? or something else.

The less info you give on what you want the longer it takes to get the help you want. If you'd explained this properly you'd have had your answer by now!
Dragynfly
Scratcher
12 posts

a call block

@deck26, they are most likely asking about a block that returns the boolean itself, not the result.

AFAIK this isn't possible in Scratch, but you can perhaps do something like this:

defineremembercodeinputifcodecontainsinputthenreturnlabel already exists return that "error".elseaddinputtocode We create a label for the code and put it at the front of a list. If a specific label already exists...defineforgetcodeinputdeleteinputofcode For completeness, we'll include this function.definepointtocodeinputifnotcodecontainsinputthenreturnlabel does not exist return that error.elsereturnitem#ofinputincode Return the position of the label for the code. If a label does not exist...definerecallcodeinputifinput=1thenhandlecase1... ...run that code. If we're calling some code at a given location...ifinput=2thenhandlecase2... Repeat this for other cases.. . .

The downside to this is, the code you can call is bounded to however many cases of code you have.
I decided to put this in a project. See https://scratch.mit.edu/projects/329038632/
deck26
Scratcher
1000+ posts

a call block

Dragynfly wrote:

@deck26, they are most likely asking about a block that returns the boolean itself, not the result.

AFAIK this isn't possible in Scratch, but you can perhaps do something like this:

defineremembercodeinputsnip

The downside to this is, the code you can call is bounded to however many cases of code you have.
I decided to put this in a project. See https://scratch.mit.edu/projects/329038632/

Seems like a huge assumption from the information we've been given but perhaps you've seen some reference to something like this.

If all they want is to evaluate a boolean the boolean statement already does that so no evaluation is required.

5>4 already returns true
Dragynfly
Scratcher
12 posts

a call block

deck26 wrote:

Seems like a huge assumption from the information we've been given but perhaps you've seen some reference to something like this.

Unfortunately it is. Maybe the solution to what OP is asking for is to just put the block into the say input?

say2<4
crispeeweevile
New Scratcher
13 posts

a call block

Found The Answer Sorry to have partially wasted your time

Powered by DjangoBB