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
Set up the following characteristic equations in the form suited to Evanss root-locus method. Give L(s), a(s), and b(s) and the
Sunny_sXe [5.5K]

Answer:

attached below is the detailed solution and answers

Explanation:

Attached below is the detailed solution

C(iii) : versus the parameter C

The parameter C is centered in a nonlinear equation, therefore the standard locus will not apply hence when you use a polynomial solver the roots gotten would be plotted against C

4 0
3 years ago
Can some please help me with my questions. The Questions are in these two pictures below. I don't know how to do this question.
ololo11 [35]

Answer: ok if you need help go to help me with a question.com

Explanation:

5 0
3 years ago
35 points an brainiest if correct
Jet001 [13]
I think the answer is B. 10D
6 0
3 years ago
Water leaves a penstock (the flow path through a hydroelectric dam) at a velocity of 100 ft/s. How deep is the water behind the
Marysya12 [62]

Answer:

155fts

Explanation:

We apply the bernoulli's equation to get the depth of water.

We have the following information

P1 = pressure at top water surface = 0

V1 = velocity at too water surface = 0

X1 = height of water surface = h

Hf = friction loss = 0

P2 = pressure at exit = 0

V2 = velocity at exit if penstock = 100ft/s

X2 = height of penstock = 0

g = acceleration due to gravity = 32.2ft/s²

Applying these values to the equation

0 + 0 + h = 0 + v2²/2g +0 + 0

= h = 100²/2x32.2

= 10000/64.4

= 155.28ft

= 155

8 0
2 years ago
Block A hangs by a cord from spring balance D and is submerged in a liquid C contained in beaker B. The mass of the beaker is 1.
nikitadnepr [17]

Answer:

a)  m_e= 3.05 Kg

b)  \rho=1072.3kg/m^3

c)  m_e= 3.05 Kg

Explanation:

From the question we are told that:

Beaker Mass m_b=1.20

Liquid Mass m_l=1.85

Balance D:

Mass m_d=3.10

Balance E:

Mass m_e=7.50

Volume v=4.15*10^{-3}m^3

a)

Generally the equation for Liquid's density is mathematically given by

m_e=m_b+m_l+(\rho*v)

\rho=\frac{7.50-(1.2+1.85)}{4.15*10^{-3}}

\rho=1072.3kg/m^3

b)

Generally the equation for D's Reading at A pulled is mathematically given by

m_d = mass of block - mass of liquid displaced

m_d=m- (\rho *v )

m=3.10+ (1072.30 *4.15*10^{-3}m^3 )

m=18.10kg

c)

Generally the equation for E's Reading at A pulled is mathematically given by

m_e=m_b+m_l

m_e = 1.20 + 1.85

m_e= 3.05 Kg

6 0
3 years ago
Other questions:
  • Brazing, Soldering and Adhesive Bonding are the types of • Liquid Solid System Welding Solid State Welding • Fusion Welding . No
    14·1 answer
  • A simply supported beam spans 25 ft and carries a uniformly distributed dead load of 0.6 kip/ft, including the beam self-weight,
    15·1 answer
  • Mining is an example of this type of business
    7·1 answer
  • A 0.91 m diameter corrugated metal pipe culvert (n = 0.024) has a length of 90 m and a slope of 0.0067. The entrance has a squar
    5·1 answer
  • Which scientist was famous for his laws on gravity?
    10·2 answers
  • Steven is starting a project that requires a specialized, experienced contractor. Which selection process is the most suitable f
    11·1 answer
  • Calculate the radius of a circular orbit for which the period is 1 day​
    13·1 answer
  • What is wrong with the following code?<br> 6<br> print (what is your name?)
    9·2 answers
  • Porque el invento de la bombilla es importante?
    6·1 answer
  • You set a sensor to transmit the wind speed on top of a mountain. Which of these languages are you most likely to have used?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!