Earlier quoted context omitted.
Not the fastest but its just about as short as yours (counting all blocks as one): http://cdn-images.9cloud.us/716/best-solution-kay_1568014138...
I would blur out those browser favorites, if I were you.
Google Blockly - a visual programming language
71–80 of 129 posts
Re: Google Blockly - a visual programming language
#72Another language that creates javascript?
Re: Google Blockly - a visual programming language
#73Can this program be made any shorter? http://www.dodaj.rs/f/1K/vW/2gLz63rl/blockly.png
Here's one with same amount of code and optimal logic (for this map) without hard coding. It also ensures that there is a forward step in every iteration of the while loop.
Basically it's just an order of preference:
Turn right > turn left > go straight
Re: Google Blockly - a visual programming language
#74Re: Google Blockly - a visual programming language
#75IMO, yes, elegant code is fantastic, but don't lose track of why we write code in the first place.
Edit: consolidating from post below.
Here's a minimal solution with optimal logic (for this map) without hard coding. It also ensures that there is a forward step in every iteration of the while loop.
Basically it's just an order of precedence:
Turn right > turn left > go straight
Re: Google Blockly - a visual programming language
#76I can see some use for example in one application where we are importing data from other systems. Something like this could be used to create a quite nice user interface for creating simple programs that would manipulate and filter the incoming data.
Re: Google Blockly - a visual programming language
#77I noticed something interesting and disturbing after reading some of the answers: people are more concerned with the length of the code rather than the optimal solution (no extra turns / backtracking). This reminds me of interviewing at MS about 12 years ago and all they cared about was the ability to write recursive code. IMO, yes, elegant code is fantastic, but don't lose track of why we write code in the first pla…
Re: Google Blockly - a visual programming language
#78Re: Google Blockly - a visual programming language
#79Given sufficient resource and polish something like this could be awesome.
Re: Google Blockly - a visual programming language
#80Love this idea for teaching kids. Reminds me of the visual programming in Click N Create / Multimedia Fusion / Games factory which was/is very advanced and powerful. Given sufficient resource and polish something like this could be awesome.