Manual execution of blocks
See original GitHub issueI’m trying to generate arduino C code using scratch block. I can’t store generated code because of vm architecture. For example, this is code for builtin ‘if’ statement
if (args, util) {
const condition = Cast.toBoolean(args.CONDITION);
if (condition) {
util.startBranch(1, false);
}
}
I want to make something like this:
if (args, util) {
const condition = Cast.toString(args.CONDITION);
const body = recursive_call_for_inner_blocks(inner_blocks);
return `if (${condition}) { ${body} }`;
}
How can I do this? Maybe there is a better way to generate code using scratch blocks?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Manual blocks - Airplane Docs
Blocks have two modes: Auto (default): Blocks execute automatically—when the previous block has completed, the next block will start running right away. Manual: ......
Read more >Block statement - jOOQ
The most basic building block in procedural languages is the block statement, which allows for creating scope (except for T-SQL, which has no...
Read more >Evaluating Code Blocks (The Org Manual)
Evaluating Code Blocks (The Org Manual) ... By default, Org enables only Emacs Lisp code blocks for execution. See Languages to enable other...
Read more >Order of execution of different Stan blocks - Modeling
Hi there, I have a question related to the sequence that different blocks in Stan are executed. Lets say I have the following...
Read more >Function Block | Manualzz
You define execution order by wiring function blocks together and indicating the data flow of any feedback wires, if necessary. If function blocks...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@caxapexac scratch-blocks was originally branched from Blockly, which does convert blocks into code. It may be easier for you to start there: https://developers.google.com/blockly
@caxapexac
It’s Smalruby ( https://github.com/smalruby/smalruby3-gui/ and https://smalruby.jp/smalruby3-gui/ ) that is forked from scratch-gui. Smalruby can generate from scratch’s block to ruby code. And it can convert ruby code to scratch’s blocks.
Related code is here: