Hi, everyone,
i am new to c++. I have been trying to write this code for a while. I am really stuck in converting my code into object oriented with structs. The card game is called My boat sails where i have to create Card struct, Player with card vector and Game with vector of cards and vector of players. I did this so far.
using hand_type = vector<string>;
using player_hands_type = vector<hand_type>;
int main () {
const int DEAL_CARDS = 7; //number of cards we can deal to each player
const int PLAYERS = 5; //number of cards we can deal to each player
player_hands_type hands;
srand(time(0));
for (int player = 0 ; player < PLAYERS ; ++player) {
hand_type hand;
generate_n(back_inserter(hand), DEAL_CARDS, getCard);
hands.push_back(move(hand));
}
print_hand(hands[0]);
cout << "\n\nWhich one to replace? ";