Google Blockly Visual Programming Language

    Blockly is a visual programming language with a web interface. Creating a program is done by connecting blocks.



    Some demos:
    Maze - use Blockly to go through the maze.
    Code - Export a Blockly program to JavaScript, Dart, Python, or XML.

    Blockly is currently in technology preview mode. All developers are invited to play around and express their ideas.



    After exporting to JavaScript:
    var n;
    var A;
    var i;
    var x;
    var j;
    n = 100;
    A = [];
    for (i = 0; i <= n; i++) {
      A[i - 1] = true;
    }
    var i_end = Math.sqrt(n);
    for (i = 2; i <= i_end; i++) {
      if (A[i - 1] == true) {
        j = Math.pow(i, 2);
        while (j <= n) {
          A[j - 1] = false;
          j = (j || 0) + i;
        }
      }
    }
    for (x = 2; x <= n; x++) {
      window.alert([x,': ',A[x - 1]].join(''));
    }

    Also popular now: