Checkers Game:

Checkers is a strategy board game for two players which involve diagonal moves of uniform game pieces and mandatory captures by jumping over opponent pieces. It is played by two opponents, on opposite sides of the 8x8 checkered gameboard. One player has the dark pieces (or 'x' tokens); the other has the light pieces (or o tokens). Each player has 12 pieces. Players alternate turns. A player may not move an opponent's piece. A move consists of moving a piece diagonally to an adjacent unoccupied square. If the adjacent square contains an opponent's piece, and the square immediately beyond it is vacant, the piece may be captured (and removed from the game) by jumping over it.

Figure: see image.

Only the dark squares of the checkered board are used. A piece may move only diagonally into an unoccupied square. The player without pieces remaining, or who cannot move due to being blocked, loses the game. Pieces move one step diagonally forwards, and capture an opponent's piece by moving two consecutive steps in the same line, jumping over the piece on the first step. Multiple enemy pieces can be captured in a single turn provided this is done by successive jumps made by a single piece; the jumps do not need to be in the same line and may "zigzag" (change diagonal direction). Pieces can move/jump only in forward direction.

Aim of the game: is to capture all the opponent's pieces or render them unable to move.

How the game ends:

  • The first player to lose all of his or her pieces loses the game.
  • If a player is put in a position where they cannot move, they lose.

Reference: https://simple.wikipedia.org/wiki/Checkers

Program Requirements:

Implement a Java-based Checkers game to be hosted in the ARENA Game system in the future. In this first version, build it as a simple console-based game played by 2 playersPlayer X and Player O. Be sure to do the following:

  • Make use of good Object-Oriented design.
  • Provide documentation using Javadoc and appropriate comments in your code.
  • Generate HTML documentation using Javadoc tool.
  • Create 2 packages: core and ui.
  • Create a separate class for the game logic called CheckersLogic.java and place it in the core package.
  • Create a separate class for the text-based UI called CheckersTextConsole.java and place it in the ui package.

Sample Output:

Create a simple console-based UI as shown in the figures below.

8 | _ | o | _ | o | _ | o | _ | o |
7 | o | _ | o | _ | o | _ | o | _ |
6 | _ | o | _ | o | _ | o | _ | o |
5 | _ | _ | _ | _ | _ | _ | _ | _ |
4 | _ | _ | _ | _ | _ | _ | _ | _ |
3 | x | _ | x | _ | x | _ | x | _ |
2 | _ | x | _ | x | _ | x | _ | x |
1 | x | _ | x | _ | x | _ | x | _ |
a b c d e f g h


Begin Game. Player X – your turn.
Choose a cell position of piece to be moved and the new position. e.g., 3a-4b
3g-4h

8 | _ | o | _ | o | _ | o | _ | o |
7 | o | _ | o | _ | o | _ | o | _ |
6 | _ | o | _ | o | _ | o | _ | o |
5 | _ | _ | _ | _ | _ | _ | _ | _ |
4 | _ | _ | _ | _ | _ | _ | _ | x |
3 | x | _ | x | _ | x | _ | _ | _ |
2 | _ | x | _ | x | _ | x | _ | _ |
1 | x | _ | x | _ | x | _ | x | _ |
a b c d e f g h


PlayerO – your turn.
Choose a cell position of piece to be moved and the new position. e.g., 3a-4b
6f-5e

8 | _ | o | _ | o | _ | o | _ | o |
7 | o | _ | o | _ | o | _ | o | _ |
6 | _ | o | _ | o | _ | _ | _ | o |
5 | _ | _ | _ | _ | o | _ | _ | _ |
4 | _ | _ | _ | _ | _ | _ | _ | x |
3 | x | _ | x | _ | x | _ | _ | _ |
2 | _ | x | _ | x | _ | x | _ | _ |
1 | x | _ | x | _ | x | _ | x | _ |
a b c d e f g h


...
...
...

8 | _ | _ | _ | _ | _ | x | _ | _ |
7 | _ | _ | _ | _ | _ | _ | _ | _ |
6 | _ | _ | _ | _ | _ | _ | _ | x |
5 | _ | _ | _ | _ | _ | _ | _ | _ |
4 | _ | _ | _ | _ | _ | _ | _ | _ |
3 | x | _ | _ | _ | _ | _ | _ | _ |
2 | _ | _ | _ | _ | _ | x | _ | _ |
1 | _ | _ | _ | _ | _ | _ | _ | _ |
a b c d e f g h


Player X Won the Game

Or

8 | _ | _ | _ | _ | _ | x | _ | _ |
7 | _ | _ | _ | _ | _ | _ | _ | _ |
6 | _ | _ | _ | _ | _ | _ | _ | x |
5 | _ | x | _ | _ | _ | _ | _ | _ |
4 | _ | _ | _ | _ | _ | _ | _ | _ |
3 | _ | _ | _ | _ | _ | _ | _ | _ |
2 | _ | o | _ | _ | _ | x | _ | _ |
1 | o | _ | o | _ | o | _ | _ | _ |
a b c d e f g h


Player X Won the Game

General procedure:

  • When the game starts, indicate that it is Player X's turn. Ask the player to choose a piece to move by indicating the cell# followed by the new position, e,g, 3a-4b.
  • Check if the move is valid. If valid move, then show the state of the grid by placing the piece in the correct position (after capturing opponent piece, where applicable). Next check for "WIN/LOSE" state (i.e., if one of the players has no pieces left, or if one of the players is unable to make any legal move). Continue the game if valid moves are possible.
  • Next, indicate that it is Player O's turn. Ask the player to choose a piece to move by indicating the cell# followed by the new position, e.g., 3a-4b.
  • A player wins the game when the opponent cannot make a move. This could be the case because all of the opponent's pieces have been captured or because all of opponent's pieces are blocked in.
  • Only allow moving forward.
  • You don't have to implement 'Kinging or Crowning or Double piece features.
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.