Respuesta :

Answer:

Explanation:

The following code is written in Java. It creates the class OrthokonBoard which holds a 4x4 grid board in which each space is an "x" . Once the user creates an OrthokonBoard object they need to pass the positions of player 1 and 2 as an integer array of an x and y coordinate on the grid. Then the constructor of the object places the players on the board. A test version of the class was added to the main method and the output can be seen in the attached picture below.

class Brainly {

   public static void main(String[] args) {

       int[] player1Pos = {1, 1};

       int[] player2Pos = {3,3};

       OrthokonBoard newBoard = new OrthokonBoard(player1Pos, player2Pos);

       for (char[] x : newBoard.board) {

           System.out.println("");

           for ( char y : x) {

               System.out.print(y + " ");

           }

       }

   }

}

class OrthokonBoard {

   char[][] board = {{'x', 'x', 'x', 'x'}, {'x', 'x', 'x', 'x'}, {'x', 'x', 'x', 'x'}, {'x', 'x', 'x', 'x'}};

   public OrthokonBoard(int[] playerOnePos, int[] playerTwoPos) {

       board[playerOnePos[0]][playerOnePos[1]] = '1';

       board[playerTwoPos[0]][playerTwoPos[1]] = '2';

   }

}

Ver imagen sandlee09