Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class PieceType {
- static final int EMPTY = 0, RED = 1, RED_KING = 2, BLACK = 3, BLACK_KING = 4;
- static int [][] locationArray = new int[8][8];
- PieceType(int type) {
- //piece = type;
- }
- public static int[][] typeOfPiece(int row, int col) {
- if ( row % 2 == col % 2 ) {
- if (row < 3)
- locationArray[row][col] = BLACK;
- else if (row > 4)
- locationArray[row][col] = RED;
- else
- locationArray[row][col] = EMPTY;
- }
- else {
- locationArray[row][col] = EMPTY;
- }
- return locationArray;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement