Shared publicly  - 
 
Google released this visual programming language named Blockly. It's really neat, reminds me of Scratch.

http://code.google.com/p/google-blockly

Below is my solution to the maze demo.
36
33
Luis E. Rodriguez's profile photoMike Beardmore's profile photoKendrick H.'s profile photoUsman Saeed's profile photo
30 comments
 
Is this the same thing that drives App Inventor?
 
At first I thought this was an April Fool's joke...
 
Looks very much like the interface from App Inventor.
 
I've seen a lot of projects try to simplify programming with modeling, but they are all try to make building "imperative logic" model easy.  That's not very useful, IMO. Declarative logic modeling, even non-visual, like spreadsheet, is way more useful in practice. It's a lot more interesting to explore declarative modeling approach rather than invent yet another system to build executable flowchart.
 
Your last 'if' block is redundant and can be deleted :)
 
The last if statement is unnecessary. After you turn right, it will loop back around, and then the inner loop will take care of what the if statement did.

That aside, this looks pretty interesting. I would prefer regular programming languages, but for someone new to programming, this might be a good introduction.
 
+Sakesun Roykiattisak I've seen a number of better ways to express code visually, but it's often difficult to model a complete system; for example, implementing imperative procedures in languages primarily designed for control systems.

Model-based languages are useful IMHO, but only for a subset of problems. You still need glue code in conventional languages to tie it all together.
 
Looking at the code, it doesn't seem that this is limited to one style of programming. They have blocks and generators for JavaScript, Python, Dart etc, but it's all optional. You can create your own blocks and generate whatever you want for output.

There /might/ be a limit to the type of structure you can model, it looks like the current set of icon features would only support creating tree structures (though there can be more than one). I didn't spend enough time in the code to verify that this is a limitation of the engine vs. just the features they are using for the demos.

FWIW There is another project similar to this one at http://waterbearlang.com/
 
I'd have liked a source of randomness for the Maze.
 
shorter one:

repeat while true:
  do turn left
  repeat while wall ahead:
    do turn right
    move forward
 
+Eric Casteleijn, are you sure that's right? I'd have thought it has me oscillating between the start and one cell to its right.
 
I'm not sure that there isn't a corner (ha) case I haven't thought of, and even less sure that it's the fastest solution, but it did work on the maze I was presented with.
 
A direct route, though with some unnecessary turns.

  while true:
    turn left
    move forward
    turn right
    move forward
 
+Eric Casteleijn, oh, I didn't realise we all got individual mazes. That seems a bit poor since the blocks presented aren't sufficient for a general maze solver. +Andrew Gerrand's follow-the-right-wall would have problems too, e.g. starting at the bottom-left crossroads of a nought and crosses grid facing north.
 
Not sure that we do, and yeah a general solver is hard in the face of loops.
 
I've been mulling over the idea of a "blockly" which you program using real wooden blocks and the digital image gets converted into a program like the above. That would be kind of fun for kids (I think...)
 
I kept trying to make a 'follow right wall solution' but failed. I am not a programmer by any means, though.
 
I'm not much of a programmer, is my feeling correct that it's impossible to program a universal code for any sort of maze with this?
I've tried, but I end up in an infinite loop and get stuck x)
 
Yeah, a universal one is probably impossible if there's no way to remember where you've been, and for that you'll at least need variables. Doesn't mean that won't be added to the language though.
 
Thanks.
I'll keep trying, though, it's fun programming with this. I'd also just wish for a random maze generator.
 
+Dmitry Chestnykh hahaha! I don't know about Google, but I plan to use generic wooden blocks...  ;-)
Add a comment...