Reverse Codification Lite

A 23 KB project that allows you to convert blocks to text and back. It uses some of the latest features in Snap!


The # of slots of () block (it's hidden) counts the number of slots in variadic inputs by taking the list version of the block, removing all the inputs for a variadic input one at a time, and counting the difference between the original block and the modified block.


  • Reverse Codification Lite script pic
    Converts the specified block to a string.
  • Reverse Codification Lite script pic
    Converts text from the previous block back to block form.
  • Reverse Codification Lite script pic
    Creates a library of blocks. Use this in the list input of the previous block. You can also store the value in a variable if you plan to generate lots of blocks and want to speed up the process.

You can convert any block to text as long as it's in the library.


Example:


:link: Project Link

Oops found a bug gotta fix it

How does this work? why do we need it?

you can transfer blocks between scenes, store block in browser storage, etc

There is currently a bug with decoding rings, I'm fixing it right now.

Oh nice!

This is fixed; I need to fix another bug with 2d lists

Done

How do I detect if a variadic is empty?

yeah,the problem about reverse codification is that there is still data in the item(1)of splitted stuff
it would be nice if you can extract that data



You could,however,read the slot shape to retain the data.
Neither one of these work tho



I already have a block that does all of that, it just cant detect empty ones

i dont see how

its hidden block

ik
Reverse Codification Lite script pic
but i dont see how it works

wdym?

i dont know how it works

i broke it by making a block

?

what did you do?
edit: oh i see what you did