int waitTime;
int startTime;
int reactTime;

void setup()
{
  Serial.begin(9600);
  pinMode(13, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(3, INPUT);
}

void loop()
{
  Serial.println("When the LED turns on, push the button!");
  Serial.println("Now, watch the LED. Ready?");
  waitTime = random(2000, 4000);
  delay(waitTime);
  
  digitalWrite(13, HIGH);    

  startTime = millis();

  while(digitalRead(3) == HIGH) 
  { 
  }

  reactTime = millis() - startTime;
  
  digitalWrite(13, LOW);

  if (reactTime <= 215)
  {
    digitalWrite(12, HIGH);
    digitalWrite(11, LOW);
  }
  else
  {
    digitalWrite(12, LOW);
    digitalWrite(11, HIGH);
  }
  
  Serial.print("Nice job! Your reaction time was");
  Serial.print(reactTime);
  Serial.println("milliseconds");
  delay(1000);
}