I have 3 LED (l1,l2,l3) can be mapped to 3 switches (s1, s2, s3) and every switch can be mapped to any number of leds.
For example, I want to set l1,l2 to turn on by s1. l2,l3,l1 to s2 and l2,l3 to s3.. Like this whenever needed I want to assign switches to leds
This does of course assume that your switches send a high signal when pressed, and of course this routine isn't generic - the "mapping" is hardcoded. I, too, am having trouble understanding what you are asking but I hope this helps
First thing I would do is establish a truth table of 6 columns. The first 3 columns will be switches and the second 3, the LEDs. Then you put a "1" where any switch goes on and a "1" for any led lit. Say leds 2 and 3 must come on when switches 1 and 2 are on, you would get this:
s1 s2 s3 l1 l2 l3
1 1 0 0 1 1
From there you could reduce any redundancies- say if s1 and s2 together light l3, and s1 and s3 also light l3, you could (maybe) reduce that to s1 by itself.
Then probably code it along the lines of what acegard said