Homework/HW03/canfield.cc
void performAction(char answer)
{
    switch (answer) 
    {
        case 'q':
        case 'Q':
            quit = true;
            break;
            //case 'n': this causes problems because it's next to m
        case 'N':
            newGame();
            break;
        case 'm':
        case 'M':
            if (!playerHasWon)
                move();
            break;
        case 'd':
        case 'D':
            if (!playerHasWon)
                deal();
            break;
        case 'r':
        case 'R':
            //Repeat the last move the user made, if possible.
            if (!playerHasWon)
                move(true);
            break;
    }
    if (!quit)
        printGame();
}
// Performs an action based on the user's choice.
Performs an action based on the user's choice.
Performs an action based on the user ' s choice .
void performAction(char answer)
{
    switch (answer) 
    {
        case 'q':
        case 'Q':
            quit = true;
            break;
        case 'N':
            newGame();
            break;
        case 'm':
        case 'M':
            if (!playerHasWon)
                move();
            break;
        case 'd':
        case 'D':
            if (!playerHasWon)
                deal();
            break;
        case 'r':
        case 'R':
            if (!playerHasWon)
                move(true);
            break;
    }
    if (!quit)
        printGame();
}
void performAction ( char answer ) { switch ( answer ) { case ' ' : case ' ' : quit = true ; break ; case ' ' : newGame ( ) ; break ; case ' ' : case ' ' : if ( ! playerHasWon ) move ( ) ; break ; case ' ' : case ' ' : if ( ! playerHasWon ) deal ( ) ; break ; case ' ' : case ' ' : if ( ! playerHasWon ) move ( true ) ; break ; } if ( ! quit ) printGame ( ) ; }
Performs an action based on the user's choice.
Performs an action based on the user ' s choice .
//case 'n': this causes problems because it's next to m //Repeat the last move the user made, if possible.