Advertisement
Guide
About the Blockly → Code
Blocks are a gentle way into programming: no syntax to get wrong, just pieces that fit together. Each block you add shows up immediately as real code, so you can see how a loop or an if-statement is written in JavaScript or Python — and then press Run to watch it work.
When you are ready for text, open the generated code in the Code Runner and carry on editing it there. Blockly is Google's open-source block editor, the same one behind many coding courses.
Same program, every language
The examples print exactly the same lines whether you run them as JavaScript or Python. Print blocks write to the output (not pop-up boxes), PHP prints one line per block, and joining a list of numbers into text works in Python as it does in JavaScript.
How to use it
- 1Pick an example, or start dragging blocks from the categories on the left.
- 2Watch the code on the right; switch between JavaScript, Python, PHP, Lua and Dart.
- 3Press Run to execute JavaScript or Python and see the output below.
- 4Open in Code Runner to keep editing the code as text, or download it.
Frequently asked questions
Which languages can it run?
JavaScript and Python, in your browser. PHP, Lua and Dart code is generated for you to copy or download and run elsewhere.
Why is there no “prompt for input” block?
Programs run in a background worker, which cannot open input dialogs. Use variables for the values you want to try instead.
What if my program loops forever?
Press Stop. The program runs in a separate worker, so the page stays responsive and stopping it is instant.
Is this good for teaching?
Yes — students see the real code for every block, can switch languages to compare, and can save programs as files to hand in or share.
