📄 cardgame-client.cpp
字号:
/* This is example code provided to the student *///start#include "carddeck.h"#include <qstd.h>using namespace qstd; /* For cout, endl, and more() */int main() { CardDeck deck; CardHand hand; int handSize, playerScore, progScore; cout << "How many cards in a hand? " << flush; handSize = promptInt(); do { hand = deck.deal(handSize); cout << "Here is your hand:" << endl; cout << hand.toString() << endl; playerScore = hand.getValue(); cout << QString("Your score is: %1 points.") .arg(playerScore) << endl; // Now a hand for the dealer: hand = deck.deal(handSize); progScore = hand.getValue(); cout << "Here is my hand:" << endl; cout << hand.toString() << endl; cout << QString("My score is: %1 points.") .arg(progScore) << endl; cout << QString("%1 win!!") .arg((playerScore > progScore)?"You":"I") << endl; } while (more("hand"));}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -