Ok, this might be difficult to explain, so if it doesn't make sense, I
apologize. I'm playing a game that has a fairly complicated puzzle in
it, and I started thinking how I might make a C# program to figure it out.
There are four different panels, each of which has eight switches that
control two rows of lights, and each row has ten lights. Ultimately,
what needs to be done is flip one switch per panel so that each light in
each row is lit up from three of the four switches (two isn't enough,
and four overloads the circuit).
Alright, that might make no sense, so here's sort of a diagram that I
hope looks decent:
.. . . . . . . . . . . . . . . .
.. . . . . . . . . . . . . . . .
.. . . . . . . . . . . . . . . .
.. . . . . . . . . . . . . . . .
.. . . . . . . . . . . . . . . .
.. . . . . . . . . . . . . . . .
.. . . . . . . . . . . . . . . .
.. . . . . . . . . . . . . . . .
.. . . . . . . . . . . . . . . .
.. . . . . . . . . . . . . . . .
Each period is a light, and the eight columns are each controlled by one
switch on a panel. So this diagram would be repeated three more times
for the other panels.
Anyway, that's all just to give you an idea of what's going on. What I'm
asking for is some idea for how to get started with writing a program to
figure it out. I thought maybe I could duplicate these columsn as
textboxes on a form, and enter 1 or 0 for on or off, and then somehow
read through every possible combination to see which ones match up so
that in every spot (every light/period) there are three 1s and one 0.
Did that make any sense at all? If not, feel free to disregard! :)