NetsBlox / Snap--Build-Your-Own-Blocks

a visual programming language inspired by Scratch
http://snap.berkeley.edu
GNU Affero General Public License v3.0
3 stars 6 forks source link

Fix "split by blocks", add block to text and text to blocks #1514

Open gsteinLTU opened 4 months ago

gsteinLTU commented 4 months ago

This issue is mostly notes for actually porting this feature over.

The "blocks" feature is in the dropdown for "split by ", but is not functional.

Our split: https://github.com/NetsBlox/Snap--Build-Your-Own-Blocks/blob/0c8503b05d0d85249c2e538c26b5f52c0b25885d/src/threads.js#L4222

Snap! split handling "blocks" option: https://github.com/jmoenig/Snap/blob/5937085ed8c0837f82d7372d1eb938ae7fc07362/src/threads.js#L5128

This feature both turns ringified scripts into a list of blocks, it also can turn a Lisp-y string into a list of blocks.


The "data" block (aka "length of _") in Snap can now turn blocks into text/lines.

Our "data" block: https://github.com/NetsBlox/Snap--Build-Your-Own-Blocks/blob/0c8503b05d0d85249c2e538c26b5f52c0b25885d/src/threads.js#L1900

Snap! "data" block with "lines" option: https://github.com/jmoenig/Snap/blob/5937085ed8c0837f82d7372d1eb938ae7fc07362/src/threads.js#L2258


The "join" block in Snap can now turn lists of blocks into scripts and Lisp-y text into blocks

Ours?: https://github.com/NetsBlox/Snap--Build-Your-Own-Blocks/blob/cc80bc79d64fb34ac21d47bcbfc8522003907e4c/src/threads.js#L4144

In Snap: https://github.com/jmoenig/Snap/blob/5937085ed8c0837f82d7372d1eb938ae7fc07362/src/threads.js#L5015

gsteinLTU commented 4 months ago

It may be helpful to do a diff on https://github.com/jmoenig/Snap/tree/dev and https://github.com/jmoenig/Snap/commit/5937085ed8c0837f82d7372d1eb938ae7fc07362