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
Sliva [168]
3 years ago
7

Write a class named FBoard for playing a game, where player x is trying to get her piece to row 7 and player o is trying to make

it so player x doesn't have any legal moves. It should have: An 8x8 array of char for tracking the positions of the pieces.A data member called gameState that holds one of the following values: X_WON, O_WON, or UNFINISHED - use an enum type for this, not string (the enum definition should go in Board.hpp, before the class, not inside it).Data members to keep track of where the x piece is.A default constructor that initializes the array to empty (you can use whatever character you want to represent empty). It should then put four o pieces on row 7, in columns 0, 2, 4, and 6. It should put an x piece on row 0, column 3. It should also initialize the other data members.A method called getGameState that just returns the value of gameState.A method called moveX that takes as parameters the row and column of the square to move to. If the desired move is not allowed, or if the game has already been won, it should just return false. Otherwise it should make the move and return true. A piece belonging to x can move 1 square diagonally in any direction. A piece is not allowed to move off the board or to an occupied square. If x's move gets her piece to row 7, gameState should be set to X_WON.A method called moveO that takes as parameters the row and column to move from, and the row and column to move to. If the first pair of coordinates doesn't hold o's piece, or if the desired move is not allowed, or if the game has already been won, it should just return false. Othewise it should make the move and return true. A piece belonging to o can move 1 square diagonally, but the row cannot increase, so any o piece has at most two available moves. For example, if player o has a piece at (5, 2), it could move to (4, 1) or (4, 3), but not (6, 1) or (6, 3). It is not allowed to move off the board or to an occupied square. If o's move leaves no legal move for x, gameState should be set to O_WON.You do not need to track whose turn it is. Either move method can be called multiple times in a row. It doesn't matter which index of the array you consider the row and which you consider the column as long as you're consistent.Feel free to add private helper functions if you want. You may also find it useful to add a public print function to help with debugging.Do not access the array out of bounds. Make sure values are in bounds before using them to index into the array.
Engineering
1 answer:
OverLord2011 [107]3 years ago
7 0

Answer:

12345=V

Explanation:

You might be interested in
Assume that price is an integer variable whose value is the price (in US currency) in cents of an item. Assuming the item is pai
Svet_ta [14]

Answer:

  1. price = 380
  2. dollar = (price // 100) + 1
  3. print(dollar)

Explanation:

Presume the an item cost 380 cents and we set 380 to the variable price (Line 1). To estimate the number of single dollars to be paid, we can use // operator to divide price by 100 and we will get 3 (the remaining decimal point will be discarded). Then we add 3 by one. So the expression is

(price//100) + 1

*The reason we divide price by 100 is because 1 dollar = 100 cents

5 0
4 years ago
BIG POINTS AND WILL GIVE BRAINLIEST! Answer all 5 please or I can’t give brainliest and might report!
sergiy2304 [10]

Answer:

1. Prokaryotes do have their genomic DNA concentrated and localized to a small area within the cell (nucleoid region). So it's not entirely accurate to say that prokaryotes don't have a nucleus. The cell can release DNAses into the cytoplasm to degrade viral DNA, with reduced risk of degrading it's own DNA.

2.  A bioengineer would use the principles of mass and heat transfer to address a problem in human healthy by using mass and heat to solve problems in human health.

3. The key areas of controversy related to genetically modified food (GM food or GMO food) are whether such food should be labeled, the role of government regulators, the objectivity of scientific research and publication, the effect of genetically modified crops on health and the environment,

4. Biomaterial is an important part of bioengineering is because it plays a critical role in medicine today to restore function and facilitate healing for people after injury. These may be natural or synthetic and are used in medical to support, enhance, or replace damaged tissue.

5. Ethical issues that arise from modern biotechnologies include the availability and use of privileged information, potential for ecological harm, access to new drugs and treatments, and the idea of interfering with nature. Applications include agriculture and health care.

hope this helps

have a good day :)

Explanation:

8 0
3 years ago
5. Liam is working on a circuit and notices it's quite hot to the touch. What's causing the heat Liam Is noticing
TEA [102]
Option choice b is the correct answer
4 0
3 years ago
Mining is an example of this type of business
luda_lava [24]

Answer:

Mining would go under Industry organization.

5 0
3 years ago
If 1 uF capacitor is fully charged with 120 V across it, how much energy is stored in it? (a) 7.2 kJ (b) 7.2 mJ (c) 0.12 mJ (d)
jeyben [28]

Answer:

(b) 7.2 mJ

Explanation:

ENERGY STORED IN CAPACITOR: the energy is stored in capacitor in electric field

which can be calculated by expressions

E=\frac{1}{2} c v{^2}

=\frac{1}{2} 10^{-6}120^{2}

=7200×10^{-6} J

= 7.2×10^{-3} J

=7.2 mJ

4 0
3 years ago
Other questions:
  • A 2"" Sch 40 stainless steel (k = 14.9 W/m-K) pipe is to be used as the interior pipe of a double pipe heat exchanger. The expec
    6·1 answer
  • Tech A says that a gear set that has a drive gear with 9 teeth and a driven gear with 27 teeth has a gear ratio of 3:1. Tech B s
    7·1 answer
  • What is the first step in the problem-solving process, as well as in the engineering design process?
    7·1 answer
  • An n- channel enhancement- mode MOSFET with 50 nm thick HfO2 high- k gate dielectric (Pr = 25) has a flat band voltage of 0.5 V,
    5·1 answer
  • Plot the following trig functions using subplots, choosing an appropriate layout for the number of functions displayed. The subp
    8·1 answer
  • 6. Dr. Li boils water using a kettle with a 1.5 kW Nichrome (80% Ni and 20% Cr) heating element (resister heater). The diameter
    6·1 answer
  • Steam enters an adiabatic turbine at 6 MPa, 600°C, and 80 m/s and leaves at 50 kPa, 100°C, and 140 m/s. If the power output of t
    14·1 answer
  • thanh thẳng AD có kích thước và chịu lực như hình.biết P1 = 10kn, p2=5kn,M=15kn*m,a=2m.Hãy xách định phản lực liên kết tại A,b
    14·1 answer
  • Chemical engineers determine how to transport chemicals.<br> O True<br> False
    8·2 answers
  • Explain wet and dry compression tests​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!