Demonstrations like this are a regular feature of the Japanese educational TV show "Texico", which teaches logical thinking with the specific goal of preparing young children for programming.
I highly recommend it. It's extremely well made, and quite entertaining even for adults.
It's available in English, 10 minutes per episode, no subscription required:
Texaco + Mexico = Texico? The Japanese never fail to amuse foreigners with their naming.
Please submit this link to Texico. I think it deserves a broader audience.