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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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