Adde main
This commit is contained in:
parent
fe8be4dc57
commit
b9d9afbe51
25
src/othello/Main.java
Normal file
25
src/othello/Main.java
Normal file
@ -0,0 +1,25 @@
|
||||
package othello;
|
||||
|
||||
public class Main {
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
String p1 = "B", p2 = "R";
|
||||
String[][] board = initialize(p1, p2);
|
||||
State game = new State(board, p1, p2);
|
||||
while(!game.isOver()) {
|
||||
String player = game.getCurrentPlayer();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static String[][] initialize(String p1, String p2){
|
||||
String[][] board = new String[7][7];
|
||||
board[0][0] = p2;
|
||||
board[0][6] = p1;
|
||||
board[6][0] = p1;
|
||||
board[6][6] = p2;
|
||||
return board;
|
||||
}
|
||||
|
||||
}
|
@ -3,6 +3,18 @@ package othello;
|
||||
public class State {
|
||||
private int[][] plateau;
|
||||
|
||||
private String[][] board;
|
||||
private String player1;
|
||||
private String player2;
|
||||
private String currentPlayer;
|
||||
|
||||
public State(String[][] board, String p1, String p2) {
|
||||
this.board = board;
|
||||
this.player1 = p1;
|
||||
this.player2 = p2;
|
||||
currentPlayer = p1;
|
||||
}
|
||||
|
||||
public boolean isOver() {
|
||||
return false;
|
||||
}
|
||||
@ -18,5 +30,9 @@ public class State {
|
||||
public void play(int move) {
|
||||
|
||||
}
|
||||
|
||||
public String getCurrentPlayer() {
|
||||
return currentPlayer;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user