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
A 5000-lb truck is being used to lift a 1000-lb boulder B that is on a 200-lb pallet A. Knowing that the truck starts from rest
artcher [175]

Answer:

Explanation:

Total weight being moved = 5000+1000+200

= 6200 lb .

Force applied = 700 lb

= 700 x 32 = 22400 poundal .

acceleration (a) = 22400 / 6200

= 3.613 ft /s²

To know velocity after 6 ft we apply the formula

v² = u² + 2as

v² = 0 + 2 x 3.613 x 6

43.356

v = 6.58 ft/s

4 0
3 years ago
Order of Design Process steps ?
gregori [183]

Answer:

The five stages of Design Thinking, according to d.school, are as follows: Empathise, Define , Ideate, Prototype, and Test. Let's take a closer look at the five different stages of Design Thinking

Explanation:

5 0
2 years ago
A cantilever beam AB of length L has fixed support at A and spring support at B.
atroni [7]

The force in the spring will be F =\dfrac{KPl^3}{3EI}.

The deflection of the beam will be \rho = 0.15(\dfrac{KPL^3}{3EI})

<h3>What is a cantilever beam?</h3>

A rigid, horizontally extending structural member known as a cantilever is supported at only one end. Typically, it extends from a solidly affixed flat vertical surface, such as a wall.

Given that:-

  • A cantilever beam AB of length L has fixed support at A and spring support at B.
  • The spring behaves in a linearly elastic manner with stiffness k. If a concentrated load P is applied at B.

The spring force will be calculated as:-

F = kx

Deflection will be given by:-

x = \dfrac{PL^3}{3EI}

The spring force will be calculated by:-

F = \dfrac{KPL^3}{3EI}

The deflection of the beam will be given as:-

\rho = \dfrac{0.15KPL^3}{3EI}

Therefore the force in the spring will be F =\dfrac{KPl^3}{3EI}..The deflection of the beam will be \rho = 0.15(\dfrac{KPL^3}{3EI})

To know more about Cantilever beam follow

brainly.com/question/16791806

#SPJ1

7 0
1 year ago
What is the difference between absolute and gage pressure?
Len [333]

Explanation:

Step1

Absolute pressure is the pressure above zero level of the pressure. Absolute pressure is considering atmospheric pressure in it. Absolute pressure is always positive. There is no negative absolute pressure.

The expression for absolute pressure is given as follows:

P_{ab}=P_{g}+P_{atm}

Here, P_{ab} is absolute pressure, P_{g} is gauge pressure andP_{atm} is atmospheric pressure.

Step2

Gauge pressure is the pressure that measure above atmospheric pressure. It is not considering atmospheric pressure. It can be negative called vacuum or negative gauge pressure. Gauge pressure used to simplify the pressure equation for fluid analysis.  

8 0
3 years ago
In multi-grade oil what is W means?
irga5000 [103]

Answer:

winter viscosity grades

Explanation:

The “W”/winter viscosity grades describe the oil's viscosity under cold temperature engine starting conditions. There's a Low Temperature Cranking Viscosity which sets a viscosity requirement at various low temperatures to ensure that the oil isn't too thick so that the starter motor can't crank the engine over.

4 0
3 years ago
Other questions:
  • A composite wall is composed of 20 cm of concrete block with k = 0.5 W/m-K and 5 cm of foam insulation with k = 0.03 W/m-K. The
    13·1 answer
  • How does running an electric current through wire cause a magnetic field?
    6·1 answer
  • Please Help It's really Important
    12·1 answer
  • 1. A copper block of volume 1 L is heat treated at 500ºC and now cooled in a 200-L oil bath initially at 20◦C. Assuming no heat
    10·1 answer
  • using the following data for july, calculate the cost of goods manufactured: beginning finished goods inventory 150,475. Ending
    5·1 answer
  • true or false modeling is making predictions about future data points not associated with your equation? Explain why.​
    12·1 answer
  • A cross beam in a highway bridge experiences a stress of 14 ksi due to the dead weight of the bridge structure. When a fully loa
    14·1 answer
  • PDC Bank is working on creating an AI application that enables customers to send SMS to the AI application to allow banking acti
    9·1 answer
  • Which one of the following best defines hardness: (a) energy absorbed by a material when an object strikes its surface, (b) resi
    8·1 answer
  • Aqueous cleaners are ________ parts cleaning agents.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!