Multiple switches and a little math

Okay, so I need to have something on my Sparkfun LCD that says:

x used: "y"

I've got the text going to lcd fine, but I need "y" to change, based on eight switches.

if switch 1 is on, add "a" to "y", if it is off, subtract "a" from "y", if switch 2 is on, add "b" to "y", etc.

How would I go about doing this?

I have to say that I think it is a bit unclear what you want, and I would love to see some code.
This is the result of me guessing what you want, without testing if it even works.

Anyways, here is:

/*
|| A simple I/O example using console
||
|| Contributed:
|| Alexander Brevig
*/
#define NUMBER_OF_PINS 8
char output[NUMBER_OF_PINS+1] = "12345678";
char outputMsgs[NUMBER_OF_PINS+1] = "abcdefgh";
byte switchPin[] = {3,4,5,6,7,8,9,10};
byte index = NUMBER_OF_PINS-1;

void setup() {
for (byte i=0; i<NUMBER_OF_PINS; i++){
pinMode(switchPin*,INPUT);*

  • }*
  • Serial.begin(9600);*
    }
    void loop(){
  • //reset index*
  • index = NUMBER_OF_PINS-1;*
  • //set states*
  • for (byte i=0; i<NUMBER_OF_PINS; i++){*
    digitalRead(switchPin_)==HIGH ? output[index--] = outputMsgs : output[index] = ' ';
    * }
    //display states*
    * Serial.print("x used: ");
    Serial.println(output);
    delay(1000);//not needed*
    }
    [/quote]_