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
What is the area enclosed by the cycle area of the Carnot cycle illustrating on a P-V diagram?
Inga [223]

Answer:

The work of the cycle.

Explanation:

The area enclosed by the cycle of the Pressure-Volume diagram of a Carnot engine represents the net work performed by the cycle.

The expansions yield work, and this is represented by the area under the curve all the way to the p=0 line. But the compressions consume work (or add negative work) and this is substracted fro the total work. Therefore the areas under the compressions are eliminated and you are left with only the enclosed area.

7 0
3 years ago
A 100 meter dash is run on a track in the direction of the vector = 2 + 7 . The wind velocity is = 5 + km/hr. The rules say that
Scrat [10]

Answer:joe mamma

Explanation:

6 0
3 years ago
Three groups of students are given study outlines for 6 weeks. One group studies 2 hours a night, a second group studies 1 hour
katrin2010 [14]

Answer:

The constant here is the study outline

Explanation:

In scientific research, the constant variable is that part/variable of the experiment that does not change or is set not to change. Examples include temperature, environment or height.

Assuming the scenery described in this question is an experiment. All the groups presented are bound by a constant during the experiment. The constant here is the study outline. The study outline provided to the students is not going to change.

NOTE: There could be confusion as regards the answer being the final exam grade but that will be the dependent variable as that will be the outcome of the experiment while the time spent to study will be the independent variable.

8 0
2 years ago
Why do you think the Combination Square is better to use than the tape
Tatiana [17]

Answer:

The correct answer to the following question will be "Because the head acts as a stop".

Explanation:

  • Since the head serves as either a stopping (especially in comparison to something like a floppy tape clip or hanger), the combination square seems to be more reliable and accurate than those of the tape measure.
  • And maybe you'll know that certain style outlines are still square to something like the sides or finishes.

So that the above seems to be the right answer.

8 0
3 years ago
The exhaust steam from a power station turbine is condensed in a condenser operating at 0.0738 bar(abs). The surface of the heat
lozanna [386]

Answer:

Percentage change 5.75 %.

Explanation:Given ;

Given

 Pressure of condenser =0.0738 bar

Surface temperature=20°C

Now from steam table

Properties of steam at 0.0738 bar  

Saturation temperature corresponding to saturation pressure =40°C      

 h_f= 167.5\frac{KJ}{Kg},h_g= 2573.5\frac{KJ}{Kg}

So Δh=2573.5-167.5=2406 KJ/kg

Enthalpy of condensation=2406 KJ/kg

So total heat=Sensible heat of liquid+Enthalpy of condensation

Total\ heat\ =C_p\Delta T+\Delta h

Total heat =4.2(40-20)+2406

Total heat=2,544 KJ/kg

Now film coefficient before inclusion of sensible heat

  h_1=\dfrac{\Delta h}{\Delta T}

  h_1=\dfrac{2406}{20}

h_1=120.3\frac{KJ}{kg-m^2K}

Now film coefficient after inclusion of sensible heat

 h_2=\dfrac{total\ heat}{\Delta T}

 h_2=\dfrac{2,544}{20}

h_2=127.2\frac{KJ}{kg-m^2K}

So\ Percentage\ change=\dfrac{h_2-h_1}{h_1}\times 100

             =\dfrac{127.2-120.3}{120.3}\times 100

                   =5.75 %

So Percentage change 5.75 %.

3 0
2 years ago
Other questions:
  • One-dimensional, steady-state conduction with uniform internal energy generation occurs in a plane wall with a thickness of 50 m
    14·1 answer
  • 3. Air at 1 atm and 20 0 C flows tangentially on both sides of a smooth flat plate of width W=10 ft and length L=10 ft in the di
    8·1 answer
  • To reduce the drag coefficient and thus improve the fuel efficiency of cars,the design of side rearview mirrors has changed dram
    11·1 answer
  • A gas contained within a piston-cylinder undergoes the follow change in states: Process 1: Constant volume from p1 = 1 bar V1 =
    9·1 answer
  • A baseband signal with a bandwidth of 100 kHz and an amplitude range of±1 V is to be transmitted through a channel which is cons
    8·2 answers
  • What is the difference between CNC and NC​
    15·1 answer
  • Water flows through a converging pipe at a mass flow rate of 25 kg/s. If the inside diameter of the pipes sections are 7.0 cm an
    13·1 answer
  • An engineer lives in Hawaii at a location where the annual rain fall is 300 inches. She decides to use the rain to generate elec
    10·1 answer
  • A driver complains that his front tires are wearing
    14·1 answer
  • Which of the following describes a tropical grassland environment?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!