Implement a board class to represent the grid

Assignment Help Computer Engineering
Reference no: EM132152079

TIC TAC TOE game in c++

You will implement a Board class to represent the 3x3 grid. This class will have functions to determine which symbol, if any, is in a cell, to place a symbol in a cell, to determine the winner, if any so far, and to print the board to standard output.

You will implement an abstract Player class to determine the player's moves. The Player class should store which symbol it will place and contain a pure virtual function to determine the Player's next move. This function will be overridden by the subclasses of Player.

You will implement PlayerHuman as a subclass of Player. When this subclass is to choose a move, it should print out the current board and ask the user for the row and column to place a symbol. This class should detect if the user enters an invalid location, either because it is not in the grid or it already has a symbol, and if the location is invalid, ask the user again.

You will implement PlayerRandom as a subclass of Player. When this subclass is to choose a move, it should return a random position in the grid that does not yet have a symbol.

You will implement a program to play the Tic Tac Toe game. The program should begin by asking the user if each team should be controlled by a human or by the computer.

The program should then use dynamic memory allocation to create instances of the appropriate subclasses of Player. These must be stored with pointers of type Player*.

The first team should place X symbols, while the second team should place O symbols. The program should then alternate asking the players for moves until one player wins, or the board is full and the game is a tie. After the game is over, the program should print the winner and the board and exit.

Reference no: EM132152079

Questions Cloud

Average time and standard deviation : A task is known to have an average time of 20 seconds and a standard deviation of 3.25 seconds. The task process has been re-structured
Displays the contents of the board array : Prompts and allows the player whose turn it is to select a location on the board for an X in the case of player X or an O in the case of player O.
Why do you think the advertisers used that fallacy in the ad : There are several types of fallacies - equivocation, false authority, ad hominem, appeal to ignorance, and bandwagon. Please provide two (2) different examples.
What is the probability that his waist size is less than 38 : The waist size of Canadian males is reported to be normally distributed with a mean of 36.33 inches and a standard deviation of 4.02 inches.
Implement a board class to represent the grid : You will implement a Board class to represent the 3x3 grid. This class will have functions to determine which symbol, if any, is in a cell.
Discuss the effects of your own enculturation : When looking for information about a particular issue, how often do you try to resist biases toward your own point of view? This assignment asks you to engage.
Higher risk for developing lung cancer : Findings from a cohort study suggest that cigarette smokers had a higher risk for developing lung cancer compared with never smokers
Describe the four steps in the lead generation process : Why do you think B2B marketers consider producing an acceptable quantity of high quality sales leads one of their most important challenges?
Find the probability of finding someone with an iq score : If one person is selected from the general population, find the probability of finding someone with an IQ score of at least 133.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Define future global cyber security technology

Discuss the social and cultural issues associated with Future Global Cyber Security technology

  Define launch a brute force attack on aes-128

How long do you think it would take to launch a brute force attack on AES-128 using a standard computer

  What is the difference between Vo iP and Volar

How will IPv6 differ from the current version (4) of IP? What are the main features of lnternet2? What is the difference between Vo iP and Volar?

  Create an array of numbers representing the amount each slip

Create an array of numbers, representing the amount each slip is rented for (monthly). Populate the array with some dollar amounts (with two decimal places).

  Who was considered the first programmer

Who was considered the first programmer? Describe her contributions to the history of computers. What company did Dr. Hollerith form?

  Define what you would change in order to improve the design

Indicate the jarring or distracting inconsistencies of the site, such as abrupt changes in any design elements, including theme and layout. define what you would change in order to improve the design.

  Calculate the mortgage payments

A program written in Java (without a graphical user interface) that will compute and display the monthly payment amount to fully amortize a $200,000.00 loan over a 30 year term at 5.75? interest.

  Does requested calculation and displays appropriate result

Assume the existence of the following Java GUI application. There are two text fields for user input. The first JTextField variable is named voltage and is used to input a voltage value in volts.

  What constraints did you experience in given issue

What was the scoop, deliverable, and results of the project? What constraints did you experience and how did you handle them?

  How zero day attack vulnerabilities are discovered

Conduct research on the Internet, and write a one-two- page paper on how zero day attack vulnerabilities are discovered.

  Problems on relation and functional dependencies

Problems on  relation and functional dependencies

  Write a program that defines and tests a factorial function

Write a program that defines and tests a factorial function. The factorial of a number is the product of all whole numbers from 1 to N.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd