scratch puzzle

Implemented using scratch1.4. The slight flicker results from the video capture/processing software.

Do you have an idea how it works ?