Hacker News new | ask | show | jobs
by tthbalazs 3508 days ago
Hey!

You might be interested in a solution that uses less blocks (i would be). I might have been lucky, took me 2-3 minutes to find this.

https://blockly-games.appspot.com/maze?level=10#taj4p4

Does anyone know of a better one?

Edit: just as i posted this i saw that you dont even need the first "Move Forward", so it is 10 lines total with 4 blocks left

1 comments

Had another look before I saw your comment, down to 3 blocks left now (12 lines). Thought my previous one was a bit messy, much better now, not sure if it can be optimised any further. Will check your link next. :)

EDIT: Nice. I was doing it slightly different to yours, https://blockly-games.appspot.com/maze?level=10#foif9x , two if statements instead would have fixed that, and the pattern becomes perfectly clear. Cheers. :)

5 blocks left (using 8 lines): https://blockly-games.appspot.com/maze?level=10#9zdu9f

But that's code bingo - fewer lines, but less efficient for the mouse.