Question: hi im working on my assignment Reversi/Othello in java. I am lost to how to check the direction. So I have been doing research how
hi im working on my assignment Reversi/Othello in java. I am lost to how to check the direction.
So I have been doing research how to do it.
Here is the part of checking direction for this game.
Please explain why it would write as it since I would like to understand it instead of copying it.
(it is a TEXT-BASED 6 by 6 board which it is named as playBoard)


Information on the Reversi Game Reversi is a board game played by two players (white and black sides) on a board with 8 rows and 8 columns. The player's goal is to have a majority of their colored pieces showing at the end of the game The game begins with four pieces placed in a square in the middle of the grid as shown below (Fig 1). The black player makes the first move Fig 1 Fig 2 The player moves by placing a piece in an empty square so they can flip an opponent disc to their color (valid move), .e. there exists at least one straight (horizontal, vertical, or diagonal) occupied line between the new piece and another black piece, with one or more contiguous white pieces between them. In Fig. 2, black has the options indicated by the white X. After placing the piece, black turns over all white pieces lying on a straight line between the new piece and any other black pieces For example, if the black side places a piece at the position indicated in Fig 3, the result is shown at the right hand side A black piece placed here Fig 3 Players take alternate tuns. If one player cannot make a valid move, play passes back to the other player. When neither player can move or the board is full, the game ends. The player with the most pieces on the board at the end of the game wins Information on the Reversi Game Reversi is a board game played by two players (white and black sides) on a board with 8 rows and 8 columns. The player's goal is to have a majority of their colored pieces showing at the end of the game The game begins with four pieces placed in a square in the middle of the grid as shown below (Fig 1). The black player makes the first move Fig 1 Fig 2 The player moves by placing a piece in an empty square so they can flip an opponent disc to their color (valid move), .e. there exists at least one straight (horizontal, vertical, or diagonal) occupied line between the new piece and another black piece, with one or more contiguous white pieces between them. In Fig. 2, black has the options indicated by the white X. After placing the piece, black turns over all white pieces lying on a straight line between the new piece and any other black pieces For example, if the black side places a piece at the position indicated in Fig 3, the result is shown at the right hand side A black piece placed here Fig 3 Players take alternate tuns. If one player cannot make a valid move, play passes back to the other player. When neither player can move or the board is full, the game ends. The player with the most pieces on the board at the end of the game wins
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
