This game is great because it constantly presents you with obviously impossible things that end up working. Rainbow seems impossible to me right now.
just take a small block from the starting block and use it as a timer for when to switch direction