Arduino ethernet need help with game logic! I'm making a game where there are three LEDs and three buttons: 1 LED for 1 button. One has to press the button that has its LED lit. If it is correct, another (random) LED will light up and the game continues. However, if one presses one that isn't lit, one has points taken from one's score.

Example image: http://i.imgur.com/xSUrVRV.png 

I'm having trouble figuring out how to find out when the wrong one is pressed. With the code below it will print "Ouch" whenever the led switches numbers.

Code that switches LED:

led = random(1, 4);
switch(led) {
  case 1:
    ledLeftState = HIGH;
    break;
  case 2:
    ledMiddleState = HIGH;
    break;
  case 3:
    ledRightState = HIGH;
    break;
}


Code that checks if the wrong button is pressed:

 if(digitalRead(BUTTON_LEFT) == LOW &amp;&amp; led != 1 || digitalRead(BUTTON_MIDDLE) == LOW &amp;&amp; led != 2 || digitalRead(BUTTON_RIGHT) == LOW  &amp;&amp; led != 3) {
    static unsigned long lastTime = 0;
    if(millis() - lastTime &gt; 400) {
      Serial.println("Ouch, minus ten miliseconds!");
      hurt += 10;
      lastTime = millis();
    }
  } 


Hopefully you can figure this scenario out in your heads, otherwise simply tell me that you'd like code instead of downvoting.

Thanks for your time!
The line

if(millis() - lastTime &gt; 400)


is supposed to test that the button press does not come right after the
LED switches. This means the line

lastTime = millis();


should be right when you change the displayed LED.