Need help with creating the game Reversi using implementation. The details are l
ID: 3872503 • Letter: N
Question
Need help with creating the game Reversi using implementation. The details are listed below.
Project Description
Reversi (also known as “Othello”) is a two-player board game that involves strategically placing two-sided pieces on a grid until no more pieces can be placed. Each move made results in one or more pieces getting flipped, changing ownership of those pieces. Your job is to implement this game on the command line, allowing for all different player matchups including human vs. computer, human vs. human, and computer vs. computer. You will implement different levels of computer intelligence. To get a better understanding of the game, play a couple of rounds of reversi. For further reading, see the Wikipedia entry for reversi.
Reversi Overview
The game board is an 8×8 grid.
The two opponents, dark and light, alternate turns.
Game pieces have two sides: dark and light.
Dark makes the first move.
For each turn, the player must place a single piece with their color facing up in an empty cell, so that there exists at least one straight line (horizontal, vertical, or diagonal) between that piece and another piece of the same color, with an unbroken line of the opposing team’s color in-between.
The surrounded pieces of the other color should be flipped, changing ownership from your opponent to you.
One move may create multiple lines, so multiple lines of opposing pieces can be flipped.
If a player cannot make a move, their turn if forfeited.
The game ends when:
Neither player can make a move, or;
The board is full.
Whichever player has more pieces showing their color at the end wins the game. A tie is possible.
Implementation
Implement and document the classes you described in UML. Be sure to include in-line Java comments and white space where appropriate in order to make your code both readable and clear. Since the classes are in a package, you may need to carefully structure your project directory. Feel free to do this manually or using Maven.
You need to also do the following:
You should create a directory called cs1302-reversi for this project. If compiling and running manually, then you should structure things so that they can be compiled and run directly inside of this directory.
Include properly formatted Javadoc comments for all classes, constructors, and methods. In addition to descriptions, please include @param and @return tags where appropriate. We will generate the HTML version of your documentation in order to check your Javadoc.
Create an INSTRUCTIONS.md file to include instructions on how to both compile and run your program, assuming one is in the cs1302-reversi directory.
Your code should run, for example, by entering the following command:
Your game will be an interactive command-line application that is configured using command-line arguments. In the example provided in this project description, available spaces are marked with the underscore character, but this is not required. You should find an intuitive way to play against a computer, such as hard coding a delay before the computer makes its move. We used X and O as the dark and light pieces here, but you may experiment with other options.
Here is an example of one round of the game:
Explanation / Answer
Welcome to Reversi! Moves should be entered in "[row] [column]" format.
1 2 3 4 5 6 7 8
1 . . . . . . . .
2 . . . . . . . .
3 . . . . _ . . .
4 . . . X O _ . .
5 . . _ O X . . .
6 . . . _ . . . .
7 . . . . . . . .
8 . . . . . . . .
Enter your move, X player: 3 5
1 2 3 4 5 6 7 8
1 . . . . . . . .
2 . . . . . . . .
3 . . . _ X _ . .
4 . . . X X . . .
5 . . . O X _ . .
6 . . . . . . . .
7 . . . . . . . .
8 . . . . . . . .
Enter your move, O player: 3 4
Welcome to Reversi! Moves should be entered in "[row] [column]" format.
1 2 3 4 5 6 7 8
1 . . . . . . . .
2 . . . . . . . .
3 . . . . _ . . .
4 . . . X O _ . .
5 . . . O X _ . .
6 . . . _ . . . .
7 . . . . . . . .
8 . . . . . . . .
Enter your move, X player: 3 6
1 2 3 4 5 6 7 8
1 . . . . . . . .
2 . . . . . . . .
3 . . . _ X _ . .
4 . . . X X . . .
5 . . . O X _ . .
6 . . . . . . . .
7 . . . . . . . .
8 . . . . . . . .
Enter your move, O player: 3 4
Welcome to Reversi! Moves should be entered in "[row] [column]" format.
1 2 3 4 5 6 7 8
1 . . . . . . . .
2 . . . . . . . .
3 . . . . _ . . .
4 . . X X O _ . .
5 . . _ O X . . .
6 . . . . . . . .
7 . . . . . . . .
8 . . . . . . . .
Enter your move, X player: 4 3
1 2 3 4 5 6 7 8
1 . . . . . . . .
2 . . . . . . . .
3 . . . _ X _ . .
4 . . . X X . . .
5 . . . O X _ . .
6 . . . . . . . .
7 . . . . . . . .
8 . . . . . . . .
Enter your move, O player: 3 4
Welcome to Reversi! Moves should be entered in "[row] [column]" format.
1 2 3 4 5 6 7 8
1 . . . . . . . .
2 . . . . . . . .
3 . . . . _ . . .
4 . . . X O _ . .
5 . . _ X X . . .
6 . . . _ . . . .
7 . . . . . . . .
8 . . . . . . . .
Enter your move, X player: 3 4
1 2 3 4 5 6 7 8
1 . . . . . . . .
2 . . . . . . . .
3 . . . _ X _ . .
4 . . . X X . . .
5 . . . X X . . .
6 . . . . . . . .
7 . . . . . . . .
8 . . . . . . . .