How to make Mindstorms respond differently, depending on which sensor is triggered? I am new to Mindstorms (but in my day job I am a programmer). 

I want to make my robot do one thing if the touch sensor on port 1 is pressed, and do something different if the touch sensor on port 2 is pressed.  

If nothing is pressed, I want it to keep driving straight ahead.  

I can see how to tell it to drive along until one of the sensors is triggered.  I.e. "drive along until sensor 1 is pressed", but I can't see how to say "... until either sensor 1 or sensor 2 is pressed". 

In answer, it would be great if you could:


tell me the blocks to use
give me a screenshot of a program
link to a program which has a similar effect
I believe one possible answer can be found in the sample program for the color sorter in the Mindstorms control software. The technique that kit uses is to create a series of nested if/then loops:

if (Color == red) {
  //do red things here
} else {
  if (Color == blue) {
    //do blue things here
  } else {
    if (Color == green) {
      //do green things here
    } else {
      if (Color == yellow) {
        //do yellow things here
      } else {
        //default actions here
      }
    }
  } 
}


Using this as a template, you could use a structure like:

if (Touch Sensor 1 == Pressed) {
  // Special Action 1 (i.e. turn left)
} else {
  if (Touch Sensor 2 == Pressed ) }
    // Special Action 2 (i.e. turn right)
  } else {
    // Default Action (i.e. drive forward)
  }
}


Hope this helps - I don't have quick access to the Mindstorms environment right now or I could set up a quick screen shot. I can only refer you to the ColorSorter program in the samples.