Blocks-based script editing (including boosters)

During my eternacon talk (about accessibility of content such as scripting), someone mentioned the idea of using blocks-based programming to create scripts. Apparently google created a javascript library called Blockly for doing such things, which allowed me to create this: https://eterna-blockly.firebaseapp.com/.

This page, and the entire Blockly library in fact, are for use as a stepping stone into programming, and not as a tool for people who already know how to code.
I plan to make a youtube tutorial explaining how to use this tool and how to move code from it into eterna, and to change the UI to be better for learning (this UI is taken from a demo with multiple languages).

I have some questions regarding this tool which I would like to hear other programmers’ opinions about:
First, Blockly’s default is to operate in 1-based indexing, meaning that arrays start at index 1 and not 0 (unlike javascript). I decided to go with 0-based indexing, but since eterna has 1-based indexing in its UI, it might not be a good idea.
Another question is how faithful should I be to the original API. If you look at the block EternaScript Boosters -> Get field _ of the target of state _, you will see that I have a large amount of options, which are all I could found in the current labs (I’m sure there were more in OpenTB). How should I split this? Should I even have all of those options available? I know that I can have the user select “secstruct”, and then select whether they want the structure-string, the array of indices to be bound, or the boolean array for which bases should be bound, but this is beyond by Blockly knowledge at this moment.

3 Likes

Just wish to say that I love what you have done, Masterstormer! I look forward to the youtube tutorial. 

For those who haven’t seen programming blocks before, here is a nice introduction: https://blockly-games.appspot.com/

1 Like