i would to like need the baisc Othello as this :
0 : 0 0 0 0 0 0
1 : 0 0 0 0 0 0
2 : 0 0 1 2 0 0
3 : 0 0 2 1 0 0
4 : 0 0 0 0 0 0
5 : 0 0 0 0 0 0
i would to like need the baisc Othello as this :
0 : 0 0 0 0 0 0
1 : 0 0 0 0 0 0
2 : 0 0 1 2 0 0
3 : 0 0 2 1 0 0
4 : 0 0 0 0 0 0
5 : 0 0 0 0 0 0
There are probably zillions of open source Othello implementations in any language imaginable. Here's one implementation.
In fact, there is a Code Golf: Reversi question right here on Stack Overflow which provides quite a number of implementations in different languages including Java.
Not sure what the "basic Othello" is, but to create that printout you can do something like:
public class Othello {
private final int[][] board;
public Othello(int size) {
if (size <4 || (size % 2) != 0)
throw new IllegalArgumentException("wrong size: " + size);
board = new int[size][size];
int half = size / 2;
board[half][half] = 1;
board[half-1][half-1] = 1;
board[half][half-1] = 2;
board[half-1][half] = 2;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
for (int i = 0; i < 6; i++) {
builder.append(" ").append(i).append(" :");
for (int j = 0; j < 6; j++) {
builder.append(" ").append(board[i][j]);
}
builder.append("\n");
}
return builder.toString();
}
}
EDIT: How to show the board:
public static void main(String[] args) {
Othello othello = new Othello(6);
System.out.println(othello.toString());
}
i don't how to eat the chess of Othello
it is the table ;
enter code here
import java.util.*;
class chess {
public static void main(String args[]) {
int array[][] = new int[6][6];
array[3][3] = 2;
array[2][3] = 2;
array[3][2] = 2;
array[2][2] = 2;
array[4][1] = 1;
array[1][2] = 1;
array[1][3] = 2;
array[2][1] = 1;
array[3][4] = 1;
array[3][5] = 2;
array[4][3] = 1;
array[3][1] = 2;
array[2][4] = 2;