Take a look at the following code, which prompts the current player for a move. If the current player is…