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. Please try not to copy and paste solution from the internet and hopefully if you can write the methods thinking of a way without using if statements - so please - i'll be thankful.
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.

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
Get step-by-step solutions from verified subject matter experts
