This is an project, to be completed on your own. It is considered dishonest either to read someone elses solution or to provide a classmate with a copy of your work. Do not make the mistake of thinking that superficial changes in a program (such as altering comments, changing variable names, or interchanging statements) can be used to avoid detection. If you cannot do the work yourself, it is extremely unlikely that you can succeed in disguising someone elses work. We are adamant that cheating in any form is not tolerated. Even the most trivial assignment is better not done than if you cheat to complete it. In this project, you will implement the logic of the game , also known as . Othello is a strategy board game for two players on a squared checkered board. It is played with identical disks that are white on one side and black on the other. Players take turns placing disks on the board with their assigned color facing up. The game starts with four disks placed in a square at the center of the board in a standard diagonal pattern: two facing white side up, two facing black side up and same-colored disk on a diagonal with each other. These four initial disks are placed by the player. The black player moves first. He must place a disk with the black side up on the board, in such a position that there exists one straight occupied line between the new disk and another dark disk, with one or more contiguous white disks between them. During a move, all bounded disks of the opponents color are turned over to the currents player color. A straight line involves: horizontal, vertical and diagonal lines in every possible direction. Players take turns to play. When a player doesnt have any valid moves, his turned is skipped. The game must keep going while there are valid moves by either player. The goal of the game is to have the when there are no more possible moves. We suggest that you play to grasp the idea. In this project, you will implement the rules and logic for Othello. You are provided with the skeleton code containing the that you need to complete to launch this game on the java console. This project consists of just one class: You should begin coding The class will contain
the following class variables: and the following instance variables: The variables spelled in all capitals represent the possible values for positions in the board. They are constant, which is why they are declared final. Final is a Java modifier to indicate that the value of these fields cannot change. Constants defined this way cannot be reassigned, and trying to do so will produce a compile-time error. By convention, the names of constant values are spelled in uppercase letters. This convention is used in many programming languages. We recommend that you follow this convention when using constant values. The board variable is a 2-d array that represents the actual board where the game is played. Each position is specified by its row and column. Each position will contain NONE when there are no disks in it, BLACK when there is a black disk facing up and WHITE when there is a white disk facing up. You need to complete the following basic methods to implement the games logic. A skeleton code is provided below. To print the board, use the method provided to you in the skeleton: . Remember that you have the freedom to add the auxiliary methods or variables that you deem helpful, as well as to reuse methods that you have coded, as long as specified methods behave as expected. An example execution is illustrated below. These test cases are to help you during your development. There are no test cases for the method and you will have to test it manually. This is an example with a board of size 4×4. We recommend that you begin to test your code with small boards. We have implemented a game where both players need to input their position to play. In most games, one of the players is played by the computer. Creating a good Othello automated player is an Artificial Intelligence problem that is outside of the scope of our class. However, with CS180 experience, you could create a couple of naive yet functional computer players to provide the experience of automated gaming. Think of that you could use and, , implement an automated player and include it in your Othello program. You have the freedom to modify the methods, add extra methods, print statements, etc, anything that you deem helpful.