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 in the block .
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 ?
bh
August 12, 2019, 3:36pm
2
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
bh
January 5, 2020, 3:34am
5
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
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
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.
bh
January 7, 2020, 1:16am
7
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
Allows for you to use some of the features that are not available to use from the UI. Most of these features work just fine.
Here is an example block to get the type for an input.
All of the values come from my blockSpec block
There will be blocks for compiling the new XML data so you can copy and paste it into a file which you can import. This is just a tool to make it easier to make blocks that take in special inputs like existing menus, variables, and the like. T…
It is possible to build one or many blocks at once.
Thank you @dardoro for this little trick !