4.8.6 游戏结束
到这个时候,玩家已经猜中了单词或者猜错次数过多。无论是哪种情况,游戏都会结束。
- //shut down
- if (wrong == MAX_WRONG)
- {
- cout << "\nYou've been hanged!";
- }
- else
- {
- cout << "\nYou guessed it!";
- }
- cout << "\nThe word was " << THE_WORD << endl;
- return 0;
- }
程序祝贺玩家,或者把他或她已被绞死的不幸消息通知给玩家。然后,程序显示出这个神秘的单词。