Created
February 4, 2014 21:37
-
-
Save olund/8812846 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main() | |
{ | |
locale swedish("swedish"); | |
locale::global(swedish); | |
srand((unsigned)time(NULL)); | |
string playerName; | |
int nrOfCardDecks = 1; | |
int cardSum = 0; | |
int cardPos = 0; | |
Card lastCard; | |
Card cardDeck[SIZE]; | |
makeCardDeck(cardDeck); | |
shuffleCardDeck(cardDeck); | |
CircularList<Player> players; | |
addPlayers(players); | |
cout<<endl; | |
cardPos = dealCards(cardDeck, players); | |
while (players.size() > 1) | |
{ | |
cout<<"New round"<<endl; | |
cardSum = 0; | |
while (handleCurrentPlayer(cardDeck, cardPos, players, cardSum)); | |
cout<<players.currentItem().getName()<<" Lost this round"<<endl; | |
players.remove(players.currentItem()); | |
// ny giv | |
shuffleCardDeck(cardDeck); | |
cardPos = dealCards(cardDeck, players); | |
} | |
cout<<"Winner : "<<players.currentItem().getName()<<endl; | |
system("pause"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment