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
Pointssss 100 and brainliest :)
Delvig [45]

Answer:

thank you for the free point have a great rest of your day

7 0
3 years ago
Technician A states that a brake lathe is used to make a used brake rotor surface "like new". Technician B states that a brake l
nikitadnepr [17]

Answer:

Both Technician A and B are correct.

Explanation: A brake lathe is a special tool used to improve or work on the surface of brake pads it helps to smoothen the surface.

Brake lathe has been found to be very effective in removing rusts in rotors and unevenness in the brake pad surfaces in order to ensure the efficiency and effectiveness of the brake system of a vehicle. Hence, a brake lathe helps to make brake rotor surface as smooth as possible.

7 0
3 years ago
Controlling your vehicle
Ratling [72]

Answer:

5. D

6. c

7. d

Explanation:

3 0
3 years ago
________ are written to “maximize” or “minimize” a specific value associated with the product needs in order to define the goal
Anna35 [415]

Answer:

Objective statements.

Explanation:

An objective statement can be defined as a short statement that explicitly states or describes what a person wants exactly or is looking out for in a particular item.

Objective statements are written to “maximize” or “minimize” a specific value associated with the product needs in order to define the goal or aim of the design process.

This ultimately implies that, objective statements are used by various manufacturing industries or companies to explicitly define the minimum or maximum requirements for the production of its goods.

4 0
3 years ago
Read 2 more answers
If you had a match and a lantern and a candle in the dark which one would you choose to light.
PSYCHO15rus [73]

Answer:

The match

Explanation:

You can light both the lantern and the candle if you light the match first.

I don't know of this is a homework question, but I answered it anyway :)

5 0
3 years ago
Read 2 more answers
Other questions:
  • Liquid water enters a valve at 300 kPa and exits at 275 kPa. As water flows through the valve, the change in its temperature, st
    10·1 answer
  • Members of the student council have been asked by their
    5·1 answer
  • If you are a government authority what extend will you modify the existing policy
    11·1 answer
  • The lift on a spinning circular cylinder in a freestream with a velocity of 30 m/s and at standard sea level conditions is 6 N/m
    7·1 answer
  • The design for a new cementless hip implant is to be studied using an instrumented implant and a fixed simulated femur.
    11·1 answer
  • A 860 kΩ resistor has 34 μA of current. What is the supply voltage for this electric circuit?
    13·2 answers
  • Technician A says that latent heat is hidden heat and cannot be measured on a thermometer. Technician B says that latent heat is
    12·1 answer
  • A typical aircraft fuselage structure would be capable of carrying torsion moment. a)True b)- False
    12·1 answer
  • PLLLLLEEESSSEEE IIII NEED ASAP
    12·2 answers
  • GOOD AFTERNOON GUYSS!! ​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!