本文整理汇总了C++中set::show方法的典型用法代码示例。如果您正苦于以下问题:C++ set::show方法的具体用法?C++ set::show怎么用?C++ set::show使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类set
的用法示例。
在下文中一共展示了set::show方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main()
{
//set up a timer and seed the random and create the decks and hands
Timer clock;
srand(time(NULL));
vector<int> deck(52*deckCount);
vector<int> copy(52*deckCount);
Dhand dealer;
Phand player;
//initialize the decks by loading in
initDeck(deck);
initDeck(copy);
char temp;
while(true)
{
cout << "What would you like to do? ((s)how, (p)lay), (l)earn: ";
cin >> temp;
switch(temp)
{
//this section is for if a human player wishes to play a single game, but havent gotten a chance to implement the play function yet, so play currently does not do much.
/*case 'p':
initDeck(deck);
shuffle(deck);
deal(dealer, player, deck);
board(dealer, player);
play(dealer, player, deck, false);
cout << endl << "========================" << endl << " NEW GAME" << endl << "========================" << endl;
break; */
case 'l':
/*runs a timer to see how quickly Runs amount takes for debugging issues.
this section first copies the original deck to a temp copy and shuffles it
as reinitializing the deck every time was too slow. It then loops through run times
in order to simulate that many games played. */
wins = 0;
clock.start();
for(long long int x=0; x<RUNS; x++)
{
copy = deck;
shuffle(copy);
deal(dealer, player, copy);
if(learn(dealer, player, copy, false))
{
wins++;
}
}
clock.stop();
cout << clock.getElapsedTime() << endl;
cout << "won: " << (wins/RUNS)*100 << "%" << endl;
break;
case 's':
info.show();
break;
}
}
return 0;
}