News for hackers. Stuff that matters.
Re:Google Blockly - a visual programming language by JoshTriplett on Thursday May 31, 2012 @05:52PM (#4050587)
An "else" would help; you can add one by hitting the + symbol on the if. With the else, you can get the shortest program that'll solve the maze (transcribing using approximate notation in lieu of a screenshot):

    while True:
        if wall(AHEAD):
            turn(LEFT)
        else:
            move(FORWARD)
            turn(RIGHT)
However, the addition of one more if makes the solution much faster and look more sensible, by not turning to the right and immediately back to the left:

    while True:
        if wall(AHEAD):
            turn(LEFT)
        else:
            move(FORWARD)
            if not wall(RIGHT):
                turn(RIGHT)
Re:Google Blockly - a visual programming language by bockris on Thursday May 31, 2012 @06:03PM (#4050635)
You can add an 'else' clause to the 'if' block by clicking the '+' which launches a sub-editor.