Google's doodle on kids coding: shortest program solving all the levels

Not my answer

6 blocks

The user Alex found a shorter solution, of length 6. I can confirm that their solution works:

O(O(Br G G, 6) Br, 5)

6 blocks

They attempted to edit this question to add this answer, so I'm assuming they want it to be displayed here. I don't like how the reputation system works around here.

The message they left:

The editor doesn't have 10 rep, but does have a solution of length 6. O(O(RGG,6)R,5)

After a few days they responded again via editing the post with: "Thanks for doing this. Editing this was the only way I saw to get a message. I am happy it exists at all. Feel free to bring it into a new post if you want though."

Old answer

7 Blocks

O(O(G G Br, 4) G Br, 100)

Patience required.

Edit: The image was wrong. 7 blocks


Actually, I found a solution with 8 blocks

O(O(O(G,4)R,4)GGR,4)

Manually found, 9 blocks

O(O(GRGLGR,4)L,4)

I started with the obvious O(O(GGR,4)L,4) that solves levels 1-5 then tried a few variations adding effectively-null moves on those levels to find one that would complete level 6. The shortest was a simple right-forward-left in the middle of each "bridge" so the forward move had no effect.