diff --git a/src/othello/Main.java b/src/othello/Main.java index 860769b..c1b0194 100644 --- a/src/othello/Main.java +++ b/src/othello/Main.java @@ -4,17 +4,17 @@ public class Main { public static void main(String[] args) { - String p1 = "B", p2 = "R"; - String[][] board = initialize(p1, p2); + int p1 = 1, p2 = 2; + int[][] board = initialize(p1, p2); State game = new State(board, p1, p2); while(!game.isOver()) { - String player = game.getCurrentPlayer(); + int player = game.getCurrentPlayer(); } } - public static String[][] initialize(String p1, String p2){ - String[][] board = new String[7][7]; + public static int[][] initialize(int p1, int p2){ + int[][] board = new int[7][7]; board[0][0] = p2; board[0][6] = p1; board[6][0] = p1; diff --git a/src/othello/State.java b/src/othello/State.java index 7dcca67..a545822 100644 --- a/src/othello/State.java +++ b/src/othello/State.java @@ -1,5 +1,6 @@ package othello; +import java.awt.Point; import java.util.ArrayList; public class State { @@ -20,8 +21,34 @@ public class State { return false; } - public ArrayList getMove(String player) { - return null; + public ArrayList getMove(String player) { + ArrayList moves = null; + + // Clonage + // Parcours du plateau de jeu + for (int i=0; i