War card game: Difference between revisions

m
Altered code to be more C++ idiomatic.
m (Minor improvement to code.)
m (Altered code to be more C++ idiomatic.)
Line 333:
}
 
bool game_over() const {
return handA.size() == 0 || handB.size() == 0;
}
 
void declare_winner() const {
if ( handA.size() == 0 && handB.size() == 0 ) {
std::cout << "The game ended in a tie" << std::endl;
Line 353:
};
 
int32_t getRank(const char ch) const {
auto it = find(PIPS.begin(), PIPS.end(), ch);
if ( it != PIPS.end() ) {
902

edits