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

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?


The trick is that you can hit the levers on the wall, but only when they're green, because then they're pointing down and you can just about reach them.

The solution should be, from left to right:

  • Hit lever 2

  • Hit lever 1

  • Hit lever 7

  • Hit lever 4

  • Hit lever 2 again


O OOO OOO O  
X XXO OOO O  
O OXO OOO O  
O OXO OXX X  
O OOX XXX X  
X XXX XXX X