Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <cstdlib>
- #include "Deck.h"
- Deck::Deck()
- {
- cards.reserve(52);
- for(int i=0; i<52; i++)
- {
- cards.push_back(Card(i%4, i%13+1));
- }
- }
- int Deck::get_num_cards()
- {
- return cards.size;
- }
- int Deck::get_card(int index)
- {
- return &cards[index]
- }
- int Deck::find_index(int suit, int value) const
- {
- while(int i=0 < 52)
- {
- if((cards[i].value==value) && (cards[i].suit == suit)) return i;
- i++;
- }
- return -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement