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
4. A person is standing 4 miles east from his house. He travels 2 miles east. a. Calculate the initial displacement. b. Calculat
Pani-rosa [81]

Answer:

4) a) s = +4\,mi, b) \Delta s = 2\,mi, 5) a) s = -2\,mi, b) \Delta s = 10\,mi

Explanation:

4) Let assume that distance with respect to origin is positive at east, while distance is negative at west.

a) The initial displacement is:

s = +4\,mi

b) The distance travelled is:

\Delta s = 2\,mi

\Delta s = 2\,mi

5) a) The final displacement is:

s = -2\,mi

b) The total distance travelled is:

\Delta s = 2\,mi + 6\,mi + 2\,mi

\Delta s = 10\,mi

5 0
4 years ago
Motorcycles are extremely hard to see if they are _______. powered by quiet motors approaching from the side driving on the shou
Assoli18 [71]

Answer: uve earned 5 b point for helping us

Explanation:well know I'm not helping u

7 0
3 years ago
Thermoplastics burn upon heating. a)-True b)- false?
miv72 [106K]

Yes, It is indeed true that Thermoplastics and thermosettingplastics burn upon heating.

4 0
3 years ago
In a tensile test on a steel specimen, true strain = 0.12 at a stress of 250 MPa. When true stress = 350 MPa, true strain = 0.26
scZoUnD [109]

Answer:

The strength coefficient is 625 and the strain-hardening exponent is 0.435

Explanation:

Given the true strain is 0.12 at 250 MPa stress.

Also, at 350 MPa the strain is 0.26.

We need to find  (K) and the (n).

\sigma =K\epsilon^n

We will plug the values in the formula.

250=K\times (0.12)^n\\350=K\times (0.26)^n

We will solve these equation.

K=\frac{250}{(0.12)^n} plug this value in 350=K\times (0.26)^n

350=\frac{250}{(0.12)^n}\times (0.26)^n\\ \\\frac{350}{250}=\frac{(0.26)^n}{(0.12)^n}\\  \\1.4=(2.17)^n

Taking a natural log both sides we get.

ln(1.4)=ln(2.17)^n\\ln(1.4)=n\times ln(2.17)\\n=\frac{ln(1.4)}{ln(2.17)}\\ n=0.435

Now, we will find value of K

K=\frac{250}{(0.12)^n}

K=\frac{250}{(0.12)^{0.435}}\\ \\K=\frac{250}{0.40}\\\\K=625

So, the strength coefficient is 625 and the strain-hardening exponent is 0.435.

5 0
3 years ago
Choose the true statement from those shown below: A Merchant Account allows you to use SSL on your web site. Disadvantages of us
Slav-nsk [51]

Answer:

The answer is A. that is, a merchant account allows you to use SSL on your website.

Explanation:

SSL means Secure Sockets Layer and this is an encryption-based Internet security protocol.

For an e-commerce merchant website or account, it is advised that an SSL package be installed to prevent any potential loss of private information.

For this reason, a merchant account allows use of SSL on your website because this also boost the confidence of client and customers visiting the website to purchase products.

7 0
3 years ago
Other questions:
  • The dry unit weight of a soil sample is 14.8 kN/m3.
    12·1 answer
  • I need calculate the reaction of the supports and calculate Mb, Qb, Nk ​
    9·1 answer
  • What does the word “robot” mean? A.Clone B. Athlete C. Servant D. Actor
    11·1 answer
  • An automobile travels along a straight road at 15.65 m/s through a 11.18 m/s speed zone. A police car observed the automobile. A
    9·1 answer
  • What car has autopilot?
    14·2 answers
  • 25 pts!!!
    12·1 answer
  • What is the number model for three families live in the same apartment
    8·2 answers
  • If you are working with an extension ladder that has 15 rungs in each of the two sliding sections, this
    12·1 answer
  • How many squares titles (20cm x 20cm) are needed to coat the sides and base of a pool which is 10m long, 6 meter wide and 3m dee
    8·1 answer
  • If you measure the voltage across a diode and it measures 0.3 V, the diode is probably made of __________ and is __________ bias
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!