using cases and confirm

Hello, I’m using a pushbutton and every diffrent click he need to do something else.
This I will do with cases.

1ste click: case 1:do something
2nd click : case 2: do something
3rd click : case 3: do something

That’s what I have now.
Buth I want to confirm a case with a double click.

1ste click:
double click : case 1:do something
2nd click :
double click : case 2: do something
3rd click :
double click :case 3: do something

Can anyone help me? Or give more info.

This I will do with cases

Why? If/else statements will work just as well, as long as the number of statements is reasonable.

Can anyone help me?

What do you need help with? How will you determine that a switch has been “double clicked”?

PaulS: Why? If/else statements will work just as well, as long as the number of statements is reasonable. What do you need help with? How will you determine that a switch has been "double clicked"?

Because I have 3 codes and every code is a game. I want to make a code where you can select the game you want to play. That's why I want to use cases.

I found a website where they describe a double lick (not sure if I need to use this) : http://www.mathertel.de/Arduino/OneButtonLibrary.aspx .

My question is How I need to combine this. Becease I can't say:

case 1: void double click () { do something }

case 2: void double click () { do something }

case 3: void double click () { do something }

Because I have 3 codes and every code is a game. I want to make a code where you can select the game you want to play. That's why I want to use cases.

switch(gameToPlay)
{
   case 1:
     pacman();
     break;
   case 2:
     checkers();
     break;
   case 3:
     chess();
     break;
}

or

if(gameToPlay == 1)
  pacman();
else if(gameToPlay == 2)
  checkers();
else if(gameToPlay == 3)
  chess();

Which is shorter and more concise?

The library allows you to define a SINGLE function to call when a double click happens. In that function, you put the increment statement to increment the game to play, and you put the if/else if or switch/case statements to play the selected game.

void doubleClickHappened()
{
   gameToPlay++;

  if(gameToPlay == 1)
    pacman();
  else if(gameToPlay == 2)
    checkers();
  else if(gameToPlay == 3)
    chess();
}