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]
4 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]4 years ago
7 0

Answer:

12345=V

Explanation:

You might be interested in
Aviation ppl onlyyyy ayoooo, thoughts on the A-10 Thunderbolt II?
Vaselesa [24]

Answer:

It’s cool I’d say 8/10 I guess

Explanation:

8 0
3 years ago
Water is flowing into the top of an open cylindrical tank (which has a diameter D) at a volume flow rate of Qi and the water flo
deff fn [24]

Answer:

Z = 3 + 0.23t

The water level is rising

Explanation:

Please see attachment for the equation

8 0
3 years ago
Read 2 more answers
A binary star system consists of two stars of masses m1m1m_1 and m2m2m_2. The stars, which gravitationally attract each other, r
d1i1m1o1n [39]

Answer:

          a_c_2=\dfrac{a_c_1\times m_1}{m_2}

Explanation:

The question is: <em>Find the magnitude of the centripetal acceleration of the star with mass m₂</em>

The <em>centripetal acceleration</em> is the quotient of the centripetal force and the mass.

                a_c=\dfrac{F_c}{m}

Thus, you can write the equations for each star:

     

       a_c_1=\dfrac{F_c_1}{m_1}

       a_c_2=\dfrac{F_c_2}{m_2}

As per Newton's third law, the centripetal forces are equal in magnitude. Then:

       a_c_1\times m_1=a_c_2\times m_2

Now you can clear a_c_2:

          a_c_2=\dfrac{a_c_1\times m_1}{m_2}

6 0
4 years ago
Ring rolling is a deformation process in which a thick-walled ring of smaller diameter is rolled into a thin-walled ring of larg
VMariaS [17]

Answer:

a)True

Explanation:

Rolling:

Rolling is a metal forming in which a material passes through two or more than two depends on conditions,rolls to produce the desired product.

Ring rolling:

 In ring rolling a thick ring compresses by rolls to produce the large diameter ring.Actually volume of material is constant so when diameter of ring increases then to compensate it, the thickness of ring reduces .In simple words we can say that in ring rolling a thick ring of smaller is rolled into a thin ring of larger diameter.  

6 0
3 years ago
in verification of ohms law the mass is 100g, initial length is 31, final length is 31.3 what is the extension?​
MissTica

Answer:

24

Explanation:

6 0
3 years ago
Other questions:
  • If a motor driven by PWM using half-bridge operation has a speed of 1,426 rpm at a duty cycle of 100% (full forward), what will
    5·1 answer
  • Carbon dioxide (CO2) at 1 bar, 300 K enters a compressor operating at steady state and is compressed adiabatically to an exit st
    11·1 answer
  • A flat, circular hydrostatic air bearing has an outer diameter of 160 mm and a 5-mm-deep recess from the 50-mm diameter to the b
    6·1 answer
  • Please please help please with this this is the link for the story PLEASE PLEASE HELP PLEASE PLEASE help please
    7·1 answer
  • Water enters a centrifugal pump axially at atmospheric pressure at a rate of 0.12 m3
    10·1 answer
  • Gn bbys sleep well<br><br><br><br><br> gn
    7·2 answers
  • A 4 stroke over-square single cylinder engine with an over square ratio of 1.1,the displacement volume of the engine is 245cc .T
    10·1 answer
  • Find the resultant of the force system on the body OABC as shown .find the points where the resultant will cut the X and Y axis?
    8·1 answer
  • Technician A says that the connecting rod and main bearing caps should be marked before removing to ensure that they can be inst
    5·1 answer
  • Question 4(Multiple Choice Worth 2 points)
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!