This commit is contained in:
Cyprien111
2025-03-31 08:33:58 +02:00
parent a00cc26e59
commit cfb05f6c11
3 changed files with 53 additions and 4 deletions

View File

@@ -3,9 +3,21 @@ import java.util.Random;
public class GomokuAI{
/**
* This class is an extends of the class Player, this allows the GomokuAI to choose his move.
*/
/** The random initialization */
Random random = new Random();
/** The difficulty of the GomokuAI */
int difficulty = 0;
//------------------Methods--------------------------
/**
* Return the coordinate of the move played by the Gomoku AI.
* @param Board The actual Gomoku board.
* @return The coordinate of the move played.
*/
public Coordinate chooseMove(GomokuBoard board){

View File

@@ -2,9 +2,18 @@
import java.io.Console;
import java.util.List;
public class Human{
public class Human extends Player{
/**
* This class is an extends of the class Player, this allows the player to choose his move.
*/
//------------------Methods--------------------------
/**
* Return the coordinate of the move played by the player.
* @param Board The actual Gomoku board.
* @return The coordinate of the move played.
*/
public Coordinate chooseMove(GomokuBoard board){
Console cons = System.console();

View File

@@ -1,14 +1,42 @@
import java.util.List;
abstract class Player{
/**
* This class is an abstract class to choose between player and Gomoku AI.
*/
/** The name of the Player */
private String name;
//------------------Constructors--------------------------
/**
* The constructor of the Player.
* @param name The name of the player.
*/
public void Player(String name){
this.name = name;
}
//------------------Gets--------------------------
/**
* Return the name of the player.
* @return The name of the player.
*/
public String getName() {
return name;
}
public abstract Coordinate chooseMove(GomokuBoard Board);
//------------------Methods--------------------------
/**
* Return the coordinate of the move played by the player.
* @param Board The actual Gomoku board.
* @return The coordinate of the move played.
*/
public abstract Coordinate chooseMove(GomokuBoard board);
}