Yeah, it really depends on what game you're doing..
It's basically a loop, until victory or defeat conditions are met.
For example, this is a Tic Tac Toe loop:
Code:
int main ()
{
init();
system("CLS");
table();
do
{
if (moves < 9)
{
getInput(playerup);
while (setInput(playerup))
{
cout << "\tThat move has already been made!\n\n";
getInput(playerup);
}
system("CLS");
table();
if (playerup == 'o')
{
playerup = 'x';
} else {
playerup = 'o';
}
} else {
cout << "\n\tNo winner this time, thanks for playing\n\n\n\t";
_getch();
return 0;
}
} while (checkWin(playerup) == 2);
if (playerup == 'x')
{
cout << "\n\tCongratulations " << playername2 << ", you've won!\n\n\n\t";
//system("PAUSE");
_getch();
return 0;
} else {
cout << "\n\tCongratulations " << playername1 << ", you've won!\n\n\n\t";
_getch();
return 0;
}
}