Logic with sprites

Hello,
I would like to create numbers of predicate functions with sprites as entries objects. Like that :

But it would be very nice to have the sprite and its color instead of LogicTests%20script%20pic0 in the block LogicTests%20script%20pic0A.
Do you know a way to drag and drop the sprite itself as the entry of a block ?

Any idea ?
Could it be a feature request ?

Nice project!

And, that's a great idea for a feature. We don't have it yet, though.

@nathalierun What's the difference between aligned and on_StraightLine? My guess is that for the latter, M must be between A and B; is that correct?

What about wrapping every sprite into reporter with colorful names :wink:
image

Once we have program-generated blocks. Definitely on the list, if we ever get past putting out fires.

There is proof of concept project:"Make a block"

Custom block

Make a block script pic

will make block from XML spec.
eg.

<blocks app="Snap! 5.4, http://snap.berkeley.edu" version="1">
<block-definition 
s="autoCreatedZZ" 
type="reporter" 
category="operators">
    <header></header>
    <code></code>
    <translations></translations>
    <inputs></inputs>
    <script>
      <block s="doReport"><l>XX</l></block>
    </script>
</block-definition> 
</blocks>

Created block
Make a block script pic (1)

XML is in default Snap serialization format. Initial pattern can be get by "Export blocks" menu. There is a "silent" version of "Make ..." without visual confirmation.

Oh that's interesting. I was thinking of converting between scripts and tree structures made of lists, but converting between scripts and xml is something we have right now! I wonder if I can build macros on top of that...

You probably cool. It is a little more computation than something native but it would work.

We did similar hacks with autograding.

Of course you can create/modify XML by regex or generative/macro ways as in project

It is possible to build one or many blocks at once.

Thank you @dardoro for this little trick !