How does Google's Bunny Hopping Doodle Calculate Solution Length?

Today's doodle is about bunnies hopping on tiles, and writing code to get the bunny to every tile

I've done some testing on level 3 and found that loops, movement, and turning all count as 1 for solution length (loop, move, move, turn -> solution length 4)

Level 3 Code Level 3 Score

Using that knowledge I went on to solve level 4, but the solution length does not match what I did

Level 4 Code Level 4 Score


Is my way of calculating the solution length incorrect, or is Google wrong about the minimum solution length for level 4?


Also came across this issue on level 6

Level 6 Code Level 6 Score


Solution 1:

You're correct, Google's wrong.

The solution length is measured by the number of "blocks" that you use. Your solution for level 4 is shorter than the one that they came up with. I don't recall what I did but I used exactly seven blocks and I remember it looked a lot "neater" than your shorter solution, which has the bunny bouncing into walls and turning unnecessarily. It's possible that whoever made the puzzle only logically came up with the "neater" solution and didn't notice that there was a shorter one possible.