public interface Player
{
/** Return an integer that represents a move in a game. */
int getMove();
/** Display the status of the game for this Player after
* implementing the next move. */
void updateDisplay();
}
A programmer plans to write programs that simulate various games. In each
case he will have several classes, each representing a different kind of competitor in the game, such as ExpertPlayer, ComputerPlayer, RecklessPlayer,
CheatingPlayer, Beginner, IntermediatePlayer, and so on. It may or may not
be suitable for these classes to implement the Player interface, depending on the
particular game being simulated. In the games described below, which is the least
suitable for having the competitor classes implement the given Player interface?
(A) High-Low Guessing Game: The computer thinks of a number and the competitor who guesses it with the least number of guesses wins. After each
guess, the computer tells whether its number is higher or lower than the guess.
(B) Chips: Start with a pile of chips. Each player in turn removes some number of chips. The winner is the one who removes the final chip. The first player
may remove any number of chips, but not all of them. Each subsequent player must remove at least one chip and at most twice the number removed
by the preceding player.
(C) Chess: Played on a square board of 64 squares of alternating colors. There are just two players, called White and Black, the colors of their respective
pieces. The players each have a set of pieces on the board that can move according to a set of rules. The players alternate moves, where a move consists of moving any one piece to another square. If that square is occupied by an opponent’s piece, the piece is captured and removed from the board.
(D) Tic-Tac-Toe: Two players alternate placing “X” or “O” on a 3 × 3 grid. The first player to get three in a row, where a row can be vertical, horizontal, or
diagonal, wins.
(E) Battleships: There are two players, each with a 10 × 10 grid hidden from his opponent. Various “ships” are placed on the grid. A move consists
of calling out a grid location, trying to “hit” an opponent’s ship. Players alternate moves. The first player to sink his opponent’s fleet wins.