Blockly

It seems that Google is developing a graphical programming language called Blockly, inspired by Scratch but web-based, with the ability to compile down to JavaScript, Dart, or Python (or raw XML, so you can process it further). I can’t say I’m all that excited about the language itself—nothing new there, just the same old tired imperative programming—but it sure is fun! Give it a try—can you solve the maze? How big of a program do you need?

About these ads
This entry was posted in challenges, programming and tagged , , , , . Bookmark the permalink.

7 Responses to Blockly

  1. xander says:

    Here’s my first solution:

    This solution will only work for the given maze and takes advantage of the fact that this maze has a very repetitive path to the end, but it has the advantage of being pretty clear. My second solution is a bit more complicated:

    This solution implements a “left-hand rule.” That is, any time you can turn left, do so, otherwise just follow the path. This has the advantage of being more general, in that any maze without loops can be solved by the algorithm. On the other hand, it is slower, and, as noted above, loops can cause problems.

  2. Doug Orleans says:

    I did it with six instructions. Fun!

  3. David Wees says:

    I recommend trying out your maze solvers with the more complicated puzzle here:

    http://www.gasolin.idv.tw/public/blockly/demos/maze/index.html

    Also, I modified Blockly a bit to turn it into an animated drawing program with a very simple set of instructions. Check out my description of how well using it went with kindergarteners here:

    http://davidwees.com/content/kindergarteners-programming

    I really like Blockly and am looking forward to extending it slightly, and maybe eventually finding a way for code that people create to be saved and shared (rather than having to take a screen-shot!).

    • xhenderson says:

      Oi! The LOGO-esque setup is great. Unfortunately, I cannot reproduce my maze solver in your environment, as it lacks a an “If…Then…Else” structure.

  4. David Wees says:

    The first link isn’t to something I created, I found it through the Blockly Google group. I have plans to extend the Drawing environment but I have put it on hiatus for now as I have more important things to complete.

  5. Visogram says:

    There is a similar webbased graphical programming tool called Visogram (http://www.visogram.com) that might be interesting for you. In contrast to Blockly it is dataflow-oriented – you connect inputs and outputs of modules. Additionally you can create user interfaces to visualize things easily. Those interfaces are purely based on web standards and run on any devices that comes with a web browser.

Comments are closed.