Advertisement
pichumy

Untitled

Jan 27th, 2014
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. #include <cstdio>
  2. #include <cstdlib>
  3. #include "Card.h"
  4. #include "Deck.h"
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8.  
  9. std::vector<Card> hand;
  10. Deck *fulldeck;
  11. int i, j, k;
  12. FILE *fp;
  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. Deck fulldeck;
  27. if (fulldeck == NULL)
  28. {
  29. printf("make_standard_deck not yet implemented ... exiting\n");
  30. exit(0);
  31. }
  32.  
  33. /* print out all of the cards */
  34. for(i=0;i<fulldeck.get_num_cards();)
  35. for(j=0;j<13 && i<fulldeck.get_num_cards();j++,i++)
  36. print_card(&(fulldeck.cards[i]));
  37.  
  38.  
  39. /* compare some cards */
  40. printf("Compare: ");
  41. print_card(&(fulldeck.get_card(5)));
  42. print_card(&(fulldeck.get_card(17)));
  43. printf(": %d\n",compare(&(fulldeck.get_card(5)),&(fulldeck.get_card(17))));
  44.  
  45. printf("find index: C 5: %d", fulldeck.find_index(0,5));
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement