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?

- algorithm algorithms approximation arithmetic art Babylonian beauty binary binomial coefficients book review bracelets carnival Carnival of Mathematics change chess chess board combinatorics consecutive cookies counting decadic decimal derivatives diagrams divisibility divisors education expansion factorization fibonacci floor foundations fractal fractions game games GIMPS graph graphs Haskell history humor hyperbinary idempotent integers integral interactive intuition irrational irrationality Ivan Niven latex logic Mersenne metric multiplication negative notation number numbers permutations pi prime primes programming proof puzzle rectangles repunit review sequence squares triangular video visualization
### Blogroll

### Fun

### Reference

### Categories

- algebra (14)
- arithmetic (35)
- books (25)
- calculus (6)
- challenges (46)
- combinatorics (6)
- complex numbers (3)
- computation (30)
- convergence (9)
- counting (28)
- famous numbers (38)
- fibonacci (14)
- fractals (12)
- games (17)
- geometry (27)
- golden ratio (8)
- group theory (3)
- humor (6)
- induction (7)
- infinity (17)
- iteration (15)
- links (70)
- logic (6)
- meta (37)
- modular arithmetic (10)
- number theory (47)
- open problems (11)
- paradox (1)
- pascal's triangle (8)
- pattern (54)
- people (19)
- pictures (28)
- posts without words (3)
- primes (23)
- probability (3)
- programming (15)
- proof (42)
- puzzles (10)
- recursion (8)
- review (17)
- sequences (26)
- solutions (24)
- teaching (9)
- trig (3)
- Uncategorized (1)
- video (18)

### Archives

- May 2014 (1)
- December 2013 (1)
- October 2013 (1)
- July 2013 (1)
- June 2013 (1)
- May 2013 (1)
- April 2013 (3)
- March 2013 (3)
- February 2013 (2)
- January 2013 (5)
- December 2012 (3)
- November 2012 (4)
- October 2012 (5)
- September 2012 (1)
- August 2012 (4)
- July 2012 (1)
- June 2012 (6)
- May 2012 (2)
- April 2012 (3)
- March 2012 (1)
- February 2012 (4)
- January 2012 (5)
- December 2011 (1)
- November 2011 (7)
- October 2011 (4)
- September 2011 (6)
- July 2011 (2)
- June 2011 (4)
- May 2011 (5)
- April 2011 (2)
- March 2011 (4)
- February 2011 (1)
- January 2011 (1)
- December 2010 (1)
- November 2010 (4)
- October 2010 (2)
- September 2010 (1)
- August 2010 (1)
- July 2010 (1)
- June 2010 (2)
- May 2010 (3)
- April 2010 (1)
- February 2010 (6)
- January 2010 (3)
- December 2009 (8)
- November 2009 (7)
- October 2009 (3)
- September 2009 (3)
- August 2009 (1)
- June 2009 (4)
- May 2009 (5)
- April 2009 (4)
- March 2009 (2)
- February 2009 (1)
- January 2009 (7)
- December 2008 (1)
- October 2008 (2)
- September 2008 (7)
- August 2008 (1)
- July 2008 (1)
- June 2008 (1)
- April 2008 (5)
- February 2008 (4)
- January 2008 (4)
- December 2007 (3)
- November 2007 (12)
- October 2007 (2)
- September 2007 (4)
- August 2007 (3)
- July 2007 (1)
- June 2007 (3)
- May 2007 (1)
- April 2007 (4)
- March 2007 (3)
- February 2007 (7)
- January 2007 (1)
- December 2006 (2)
- October 2006 (2)
- September 2006 (6)
- July 2006 (4)
- June 2006 (2)
- May 2006 (6)
- April 2006 (3)
- March 2006 (6)

### Meta

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.

It seems that I can’t embed images. The solutions are

http://yozh.org/old/images/blockly_maze-001.png

http://yozh.org/old/images/blockly_maze-002.png

I did it with six instructions. Fun!

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!).

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.

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.

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.