Advertisement
pichumy

Untitled

Jan 27th, 2014
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. #include <cstdio>
  2. #include <cstdlib>
  3. #include "Card.h"
  4. #include "GoodDeck.h"
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8.  
  9. std::vector<Card> hand;
  10. Deck fulldeck;
  11.  
  12. int i, j, k;
  13. /* create an array of card pointers */
  14. // Cards** hand = new Cards*[5];
  15. /* make a card for each one */
  16. for(i=0;i<5;i++)
  17. hand.push_back(Card(i%4, (i*17)%14));
  18.  
  19. /* print out the cards in the hand */
  20. printf("Hand: ");
  21. for(i=0;i<5;i++)
  22. hand[i].print_card(stdout);
  23. printf("\n");
  24.  
  25. /* make a standard deck of cards */
  26.  
  27.  
  28. /* print out all of the cards */
  29. for(i=0;i<fulldeck.get_num_cards();)
  30. for(j=0;j<13 && i<fulldeck.get_num_cards();j++,i++)
  31. fulldeck.get_card(i)->print_card(stdout);
  32.  
  33.  
  34. /* compare some cards */
  35. printf("Compare: ");
  36. fulldeck.get_card(5)->print_card(stdout);
  37. fulldeck.get_card(17)->print_card(stdout);
  38. printf(": %d\n",fulldeck.get_card(5)->compare(&fulldeck.get_card(17)));
  39.  
  40. printf("find index: C 5: %d", fulldeck.find_index(0,5));
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement