I'm currently taking a CS100 course in my freshman year and I've been given a project which is to create the card game 'cards against humanity'. I have a few questions reagarding this. For those of you who arent familiar with the game, it basically is a game with 4 players and each player is given 10 white cards randomly from the deck. One of the player is the card czar and has a black card with a question on it and the other 3 players answer the black card with one of their white cards. The card czar chooses which answer is funniest and gives that player a point.
the first is I found .txt files for all the black and white cards online and I imported them into my program and stored them in a vector. The only problem is each word i output line by line. How can i make it so that the entire question is printed on a single line. My code for storing the file in a vector is:
}
}
else{cout<<"unable to open file"<<endl;}
readfile.close();
}
And the output is shown as: (this just an example not the entire output)
q
Why
can't
I
sleep
at
night?
q
What's
that
smell?
My second question is how can i pick 10 random white cards from the vector i created and assign them to 3 different players. I know there's rand fucntion, but how would i go about that.
My third and final question is, is there anyway I can open multiple terminal at once when i run my code? One terminal for each player.