How do I solve this "Lights Out"-style puzzle?

How do I solve this "Lights Out"-style puzzle? - I Hate Nothing About You With Red Heart Light

After beating the pirates in their mecha-drill machine, I chased them via minecart and ended up in this dead end. Now I need to solve this puzzle to progress, but I'm having some trouble.

The puzzle

Each of the switches, when hit, will change itself and its two neighboring switches to the opposite color (red becomes green, green becomes red). The goal, presumably, is to get all switches to turn green.

The problem is, I can't reach the switches up on the wall, so they can't be toggled directly. I can only hit the switches on the floor.

I've tried to solve this for ten minutes by randomly flicking switches, and when that didn't work, I wrote a program that simulates flicking switches until all of them light up green. Thing is, my program has been running for half an hour and its tried millions of flicks, and it's still not solved... so I must be missing something. What's the trick with this puzzle?






Pictures about "How do I solve this "Lights Out"-style puzzle?"

How do I solve this "Lights Out"-style puzzle? - An Encouragement Quotes on Brown Paper
How do I solve this "Lights Out"-style puzzle? - To Do List Procrastination Quote
How do I solve this "Lights Out"-style puzzle? - High angle of concentrated female employee sitting at table in open space and thoughtfully looking away





The Lights Out Cube




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Designecologist, RODNAE Productions, Annie Spratt, Anna Shvets