Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <cstdlib>
- #include "Card.h"
- #include "Deck.h"
- int main(int argc, char *argv[])
- {
- std::vector<Card> hand;
- Deck *fulldeck;
- int i, j, k;
- FILE *fp;
- /* create an array of card pointers */
- // Cards** hand = new Cards*[5];
- /* make a card for each one */
- for(i=0;i<5;i++)
- hand.push_back(Card(i%4, (i*17)%14);
- /* print out the cards in the hand */
- printf("Hand: ");
- for(i=0;i<5;i++)
- hand[i].print_card(stdout);
- printf("\n");
- /* make a standard deck of cards */
- Deck fulldeck;
- if (fulldeck == NULL)
- {
- printf("make_standard_deck not yet implemented ... exiting\n");
- exit(0);
- }
- /* print out all of the cards */
- for(i=0;i<fulldeck.get_num_cards();)
- for(j=0;j<13 && i<fulldeck.get_num_cards();j++,i++)
- print_card(&(fulldeck.cards[i]));
- /* compare some cards */
- printf("Compare: ");
- print_card(&(fulldeck.get_card(5)));
- print_card(&(fulldeck.get_card(17)));
- printf(": %d\n",compare(&(fulldeck.get_card(5)),&(fulldeck.get_card(17))));
- printf("find index: C 5: %d", fulldeck.find_index(0,5));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement