After the code checks for snakes and ladders, the dice is rolled, and the player is moved
forward by diceRoll squares. The current loop execution then ends.
The loop’s condition (while square < finalSquare) is the same as before, but this time it is not
evaluated until the end of the first run through the loop. The structure of the do-while loop
is better suited to this game than the while loop in the previous example. In the do-while loop
above, square += board[square] is always executed immediately after the loop’s while condition
confirms that square is still on the board. This behavior removes the need for the array
bounds check seen in the earlier version of the game.