Merge branch 'master' of gitlab.isima.fr:audorival/gomoku

This commit is contained in:
Aubin DORIVAL
2025-03-31 08:46:10 +02:00
5 changed files with 33 additions and 4 deletions

12
src/ConsoleRenderer.java Normal file
View File

@@ -0,0 +1,12 @@
public class ConsoleRenderer extends GomokuRenderer {
public ConsoleRenderer() {}
@Override
public void init() {}
@Override
public void update(GomokuGame game) {}
}

View File

@@ -1,4 +1,3 @@
import java.util.List;
import java.util.Random;
public class GomokuAI{
@@ -24,7 +23,7 @@ public class GomokuAI{
int x=0,y=0;
if(difficulty == 0)
{
int rand = random.nextInt(board.getPlayableCells().lenght());
int rand = random.nextInt(board.getPlayableCells().size());
}

7
src/GomokuRenderer.java Normal file
View File

@@ -0,0 +1,7 @@
public abstract class GomokuRenderer {
public abstract void init();
public abstract void update(GomokuGame game);
}

View File

@@ -1,6 +1,5 @@
import java.io.Console;
import java.util.List;
public class Human extends Player{
@@ -50,7 +49,7 @@ public class Human extends Player{
while(!pass);
pass =board.getCell(x,y).isPlayable();
pass =board.get(x,y).isPlayable();
if(!pass)
{
System.out.println("Cette case n'est pas jouable !");

12
src/SwingRenderer.java Normal file
View File

@@ -0,0 +1,12 @@
public class SwingRenderer extends GomokuRenderer {
public SwingRenderer() {}
@Override
public void init() {}
@Override
public void update(GomokuGame game) {}
}