Jump to content

Blockly

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Benchun (talk | contribs) at 06:35, 25 November 2014 (link scratch to wiki page). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Blockly is a client-side JavaScript library for creating visual programming editors. It was written by Neil Fraser for Google and is open-source. [1] It runs in a web browser, and resembles Scratch.

Blockly uses blocks that link together to make code generation easier, and can generate Javascript, Python or Dart code as standard, but can be customised to generate any computer language. [2]

User Interface

The user interface of a Blockly program consists of a toolbar, which holds all the available blocks and a workspace, where you place the blocks. There is a trashcan on the workspace which deletes any blocks dragged onto it. [3]

Customising Blockly

Blockly comes with a basic set of blocks for common instructions, but can be customised by adding more blocks. To make a new block it needs a block definition and a generator. The definition tells Blockly how the block should look and the generator tells it how to make it's output code. There is an exmple program called Block Factory which makes writing the block defintion easier by using Blockly blocks to construct a new block.

Blockly Games

Blockly has been used to build Blockly Games, a set of educational games that teach programming concepts such as loops and conditionals.[4]

References


"Official website"