4.8.4 进入游戏主循环
接下来,程序进入游戏主循环。该循环将持续执行,直到玩家猜错次数过多或者猜中单词。
- //main loop
- while ((wrong < MAX_WRONG) && (soFar != THE_WORD))
- {
- cout << "\n\nYou have " << (MAX_WRONG - wrong);
- cout << " incorrect guesses left.\n";
- cout << "\nYou've used the following letters:\n" << used << endl;
- cout << "\nSo far, the word is:\n" << soFar << endl;