1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
pychu [463]
3 years ago
9

Write a class called OrthokonBoard that represents the board for a two-player game that is played on a 4x4 grid.

Computers and Technology
1 answer:
Elden [556K]3 years ago
6 0

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';

   }

}

You might be interested in
Which professional can film projects hire as part of their budgeted costs? You can hire special ____ lawyers and include their f
gregori [183]
This is clearly A it is not that hard
3 0
3 years ago
What is the maximum number of different codes that can be represented in 2 bytes?
olganol [36]
A two byte word has 16 bits, so there are 2^16 possible values.
5 0
3 years ago
The non-conditional boolean logical and operator is written as ____.
bixtya [17]
False because whhy would it be true. words of logic

3 0
3 years ago
Giving away free brainliest
Leni [432]

Answer:

thx

Explanation:

lol

4 0
2 years ago
Read 2 more answers
Intranets:
SOVA2 [1]

Answer:

A, C, D and E

Explanation:

An intranet is synonymous to a private LAN or WAN network but in contrast to the extranet or internet. Resources are retrieved and/ or shared within devices in the private network. It uses the internet protocol suite model of networking for communication, but also uses private IP addresses, which are not routable on the internet.

The communication between devices can be a peer to peer connection or client-server connection, using the mainframe computer technologies as the dedicated servers of the network.

7 0
4 years ago
Other questions:
  • If you save a Word file as a Web page, what type of file will it be?
    12·1 answer
  • Assume you're presenting to a live audience. What's the best set up for this audience configuration?
    14·2 answers
  • Rite a c++ function, smallestindex, that takes as parameters an int array and its size and returns the index of the first occurr
    15·1 answer
  • IaaS providers do not manage the ____
    11·1 answer
  • What's a window in computer and technology<br>​
    10·2 answers
  • The primary function of the average command is what?
    15·1 answer
  • What is the 12-bit BCD binary code for 53810? (u8q12)?
    6·1 answer
  • What is an example of bias in media?​
    9·1 answer
  • Which of the following is NOT a semantic reason for using header tags
    7·1 answer
  • Terri brought a magazine for $5, and 2 bottles of nail polish. Write an expression to represent the total amount she spent. Then
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!