DDO Vale Puzzle Solver

(taken from Lights out puzzle solver and modified)