Question: Hi, I am a fresh learner in Java and trying to make an 8 by 8 Reversi/Othello. Now I'm getting a few confusions - as

Hi, I am a fresh learner in Java and trying to make an 8 by 8 Reversi/Othello. Now I'm getting a few confusions - as such I can update values and print the board but also trying to make other methods which would help to make the code work. Here are given the below methods - and their descriptions.

public Point[] getPlaceableLocations(char player, char opponent): This method checks which locations are possible / valid for the player in turn. Then, it returns these valid positions. There are only 64 positions in our 8x8 board, so 64 is the higher limit. 8 cases need to be checked: top down, bottom up, left to right, right to left and the 4 diagonals.

public void showPlaceableLocations(Point[] locations, char player, char opponent): This method mark any valid positions with a *, so as to give some hints for the players.

public void placeMove(Point p, char player, char opponent): This method updates the situation of the board according to the moves/actions taken by the players.

There's also a point class with the code has added below for it.

Hi, I am a fresh learner in Java and trying to make

Thanks a lot and let me know if more information is needed. I'll rate good.

public class Point t public int x, y; Point(int x, int y)t this.x X this.y-y public class Point t public int x, y; Point(int x, int y)t this.x X this.y-y

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!