Simon Game programming

Vincent19:
Does that means that we need to respond faster as the counter increases ?

///////////////////////////////////////////////////////////////////////////
// Slowly cranks up the pressure
void increaseSpeed()
{
  if (turn == band)
  {
    beepdelay = 170;
    pausedelay = 80;
    return;
  }
  if (turn == band * 2)
  {
    beepdelay = 150;
    pausedelay = 60;
    return;
  }

  if (turn == band*3)
  {
    beepdelay = 120;
    pausedelay = 40;
  }
}

///////////////////////////////////////////////////////////////////////////
void loop()
{
 for (int y = 0; y < WINSTATE; y++)
 {
   output();
   input();
   increaseSpeed();  // <---------------------------------- THIS is the part that makes it go faster as the game proceeds
 }                                                               It calls the procedure "increaseSpeed" defined above
 
 win();
 
}

in the "for" loop above, until the player either wins or loses, the output code is executed, then the input code is executed, then increasespeed, and then back to output, etc.

John