Winning or Losing on the First Roll

After the first roll, if the game is won or lost, the program skips the body of the while statement (lines 42–52) because gameStatus is not equal to CONTINUE. The program proceeds to the if...else statement in lines 55–58, which prints "Player wins" if gameStatus is equal to WON and "Player loses" if gameStatus is equal to LOST.

Get C++11 for Programmers, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.