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
What objects have openings that allow liquids to pass through them.
Margaret [11]

Answer:water bottles faucets tubes showers waterfalls.

Explanation:

4 0
3 years ago
Read 2 more answers
3. Whether an accident scene is safe or not, you should first take action to help any victims.
olga_2 [115]
A (sorry have to make my answer 20 characters long so just ignore this)
7 0
3 years ago
Dampers dampers springs are used inside some valve spring to
harkovskaia [24]
The correct answer is A. Retain. Valve Stem seals
3 0
4 years ago
What are the three most common types of relearn procedures?
WITCHER [35]

Answer:

The three types of relearn procedures are auto relearn, stationary and OBD.

Explanation:

In TPMS system, after the direct service like adjustment of air pressure, tire rotation or replacement of sensors etc, is performed then maximum vehicle  often needs TPMS system relearn that needs to be performed.

For performing these relearn procedure, there are mainly three types:

  1. auto relearn
  2. stationary relearn
  3. OBD

After applying the relearn process, the TPMS system will again be in proper function.

8 0
4 years ago
10. True or False? A disruptive technology<br> radically changes the way people live and<br> work.
Anettt [7]

Answer:

<u>True</u>

Explanation:

According to Investopedia.com, "Disruptive technology is an innovation that significantly alters the way that consumers, industries, or businesses operate".

So yes, a disruptive does radically change the way people live and work.

5 0
3 years ago
Read 2 more answers
Other questions:
  • The direction of rotation of a dc series motor or a universal motor connected to a dc power source A) depends on the polarities
    15·1 answer
  • Which section of business plan should be the bulk of the plan
    7·1 answer
  • True or False: The differential lock in an AWD-equipped vehicle can be used at any time.
    10·2 answers
  • How did engineers help to create a ceiling fan
    8·1 answer
  • Drivers ED. An inflamed stomach and a poorly-functioning pancreas __________.
    6·1 answer
  • Beginning in the 1960s, various advocates of the design-build model began to agitate against the design-bid-build approach and f
    9·1 answer
  • Catalytic converters reduce the engine's tailpipe emissions of unburned hydrocarbons and carbon monoxide and
    6·2 answers
  • What is anthropology? Discuss the type of anthropology?
    5·2 answers
  • Why are diode logic gates not suitable for cascading operation?
    11·1 answer
  • During shielded metal arc welding, a welder can receive a burn comparable to sunburn if proper protective clothing is not worn.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!