Implement class that can be player in a game of tic tac toe

Assignment Help JAVA Programming
Reference no: EM13698098

Question: Specify, design, and implement a class that can be one player in a game of tic-toc-toe. The constructor should be specify whether the object is to be the first player (X's) or the second player (O's).

There should be a member function to ask the object to make its next move, and a member function that tells the object what the opponent's next move is. Also include other useful member functions, such as a function to ask whether a given spot of the tic-toc-toe board is occupied, and if so, whether the occupation is with an X or an O.

Also, include a member function to determine when the game is over, and where was draw, an X win, or an O win.

Use the class in two programs: a program that plays tic-toc-toe against the program's user, and  a program that has two tic-toc-toe objects that play against each other.

You need to implement this class and you have to satisfy the requirements specific in the instruction.

Reference no: EM13698098

Questions Cloud

Complete set of logic gates : Do 2-input AND gates which have one input inverted form a complete set of logic gates? Rationalize your answer.
What is the output of the following program : What is the output of the following program and please explain it how did you get the answer or the output and the reason. void f(int i ) { if ( i = 4 ll i = 5 )/ Line 1 { cout
Input the two integer numbers in the subroutine : Let the user to input the two integer numbers in the subroutine, then do the subsequent math and show the result in the main function.
What determines the keys used in arrays : What determines the keys used in arrays such as $_GET and $_POST?
Implement class that can be player in a game of tic tac toe : Specify, design, and implement a class that can be one player in a game of tic-toc-toe. The constructor should be specify whether the object is to be the first player (X's) or the second player (O's).
Make an explicit statement of the invariant of the set class : Prepare a new container class called ser, which is similar to a bag, except that a set can contain only one copy of any given item, you'll need to change the interface a bit.
Describe the two-wire and four-wire circuits : What is a circuit?  Describe the two-wire and four-wire circuits.  What device boosts a weak signal (analog/digital) and What is a channel?
Matlab program to add all the elements of a matrix : Create a new vector, named vector2, containing only the elements in the even numbered positions from vector1. For example, if vector1 is [0 1 2 3 4 5 6], vector2 should be [1 3 5].
Create a function that subtracts two vectors : Create a function in C++ that subtracts two vectors - prepare a program to subtract two vectors and provide all the code.

Reviews

Write a Review

 

JAVA Programming Questions & Answers

  Fixing errors in a java program

You coded the following on line ten of the class MyApplet.java:

  Part - 1build a graphical user interface for displaying the

part - 1build a graphical user interface for displaying the image groups cluster in jmjrst. design and implement using

  Consider a typical certification hierarchy

Why might Bob still not trust that the certificate for Alice truly establishes Alice as the owner of the public key in the certificate?

  Determine product a inferior or normal good

Research illustrates that prices of related goods are given by Py = $5,900 and ; Pz = $90, while average income of individuals consuming this product is M = $55,000. Is X inferior or normal good?

  Create java applet to represent grade of gas

Write a java applet (not a java application program) for costco gas station. The applet will first ask you whether you are a costco customer, then the grade of gas you want to use.

  Design and implementation of a hangman game

Design and Implementation of a Hangman game

  Die class that can hold an integer

Design a die class that can hold an integer from 1 to 6. use the dice class to create a dice game. in this game, the user chooses a number between 2 and 12 inclusive

  Prison sentence for armed burglary

Compose a letter to an employer explaining why you should be hired even though you have just completed a 5 year prison sentence for armed burglary. Specify the type of company you are applying for.

  Using a linked implementation of graph write a method

Write a method that takes two nodes as input and returns true if joining an edge between these two nodes, forms a duplicate path to one of the input nodes within the graph.

  Please write the code in java

Please write the code in java for  Recursion,  Sorting and Searching

  Design and implement a small and simple email server using

design and implement a small and simple email server using the concept of web based information system. your system

  What do you mean by nested inner class what special

q1. what is a nested inner class? what special privileges does a nested inner class have? give an example of how you

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