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
What are the disadvantages of having a liquid cooled engine?
Feliz [49]
One notable disadvantage of liquid cooling over air cooling is that it is considerably costly to set up. Cooling fans are prevalent in the market, and this overabundance of supply means they are cheap. The components of a liquid cooling system can be expensive.
5 0
3 years ago
Water is the working fluid in an ideal Rankine cycle. Saturated vapor enters the turbine at 12 MPa, and the condenser pressure i
Brilliant_brown [7]

Answer:

\dot Q_{in} = 372.239\,MW

Explanation:

The water enters to the pump as saturated liquid and equation is modelled after the First Law of Thermodynamics:

w_{in} + h_{in}- h_{out} = 0

h_{out} = w_{in}+h_{in}

h_{out} = 12\,\frac{kJ}{kg} + 191.81\,\frac{kJ}{kg}

h_{out} = 203.81\,\frac{kJ}{kg}

The boiler heats the water to the state of saturated vapor, whose specific enthalpy is:

h_{out} = 2685.4\,\frac{kJ}{kg}

The rate of heat transfer in the boiler is:

\dot Q_{in} = \left(150\,\frac{kg}{s}\right)\cdot \left(2685.4\,\frac{kJ}{kg}-203.81\,\frac{kJ}{kg} \right)\cdot \left(\frac{1\,MW}{1000\,kW} \right)

\dot Q_{in} = 372.239\,MW

3 0
3 years ago
Read 2 more answers
A structural component in the form of a wide plate is to be fabricated from a steel alloy that has a plane-strain fracture tough
jeyben [28]

Complete question:

A structural component in the form of a wide plate is to be fabricated from a steel alloy that has a plane strain fracture toughness of 98.9 MPa root m (90 ksi root in.) and a yield strength of 860 MPa (125,000 psi). The flaw size resolution limit of the flaw detection apparatus is 3.0 mm (0.12 in.). If the design stress is one-half of the yield strength and the value of Y is 1.0, determine whether or not a critical flaw for this plate is subject to detection.

Answer:

Since the flaw 17mm is greater than 3 mm the critical flaw for this plate is subject to detection

so that critical flow is subject to detection  

Explanation:

We are given:

Plane strain fracture toughness K = 98.9 MPa \sqrt{m}

Yield strength Y = 860 MPa

Flaw detection apparatus = 3.0mm (12in)

y = 1.0

Let's use the expression:

oc = \frac{K}{Y \sqrt{pi * a}}

We already know

K= design

a = length of surface creak

Since we are to find the length of surface creak, we will make "a" subject of the formula in the expression above.

Therefore

a= \frac{1}{pi} * [\frac{k}{y*a}]^2

Substituting figures in the expression above, we have:

= \frac{1}{pi} * [\frac{98.9 MPa \sqrt{m}} {10 * \frac{860MPa}{2}}]^2

= 0.0168 m

= 17mm

Therefore, since the flaw 17mm > 3 mm the critical flow is subject to detection  

3 0
3 years ago
Read 2 more answers
Gasoline has a comparatively high Btu per gallon rating of around
Shalnov [3]

Answer:

A

Explanation:

4 0
3 years ago
QUESTION 3
lianna [129]
D D D D D D D D D D D D D D D DdDdddddf
6 0
3 years ago
Other questions:
  • Make a proposal to add a small pizza shop to a historical part of town. How could it be designed to “fit” into the area?
    7·2 answers
  • 12. Dies are turned using a special tool called a/an
    10·1 answer
  • A three-phase voltage source with a terminal voltage of 22kV is connected to a three-phase transformer rated 5MVA 22kV/220V. The
    8·1 answer
  • The water behind Hoover Dam in Nevada is 221 m higher than the Colorado River below it. At what rate must water pass through the
    6·1 answer
  • An automobile having a mass of 1100 kg initially moves along a level highway at 110 km/h relative to the highway. It then climbs
    7·1 answer
  • Two aerial photographs were taken 30 seconds apart over one east-bound lane of l-80 near Grand Island, NE. The following results
    12·1 answer
  • Please help i will give brainilest
    12·2 answers
  • How much thermal energy is needed to raise the temperature of 15kg gold from 45⁰ C up to 80⁰ C​
    10·1 answer
  • Make a sketch of a simple mechanically expanded brake and indicate the forces ​ ​ acting on the leading shoe when the brake is a
    10·1 answer
  • The velocity components expressed in m/s<br>​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!