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

  The class overloaded constructor receives a 2-dim int array

The class overloaded constructor receives a 2-dim int array as a parameter and assigns its values to a private 2-dim int array. Have another method that prints the whole 2-dim table.

  Console application for a small car servicing company

Develop a program for the service department staff - Console application for a small car servicing company

  Write a program that displays a frame window w pixels wide

Write a program that displays a frame window W pixels wide and H pixels high. Use the Scanner to enter the values for W and H. The title of the frame is also entered by the user.

  Specify, design, and implement a class

Specify, design, and implement a class that can be used in a program that simulates a combination lock. The lock has a circular knob with the numbers 0 through 39 marked on the edge, and it has a three-number combination, which we will call x,y,z.

  T an array using insertion sort and track the number of swap

How to sort an array using insertion sort and track teh number of swaps during the sorting

  Create an employee class.

Create an Employee class. Items to include as data members are employee number, name, date of hire, job description, department, and monthly salary.

  Describe the basic c syntax for creating a class comprise

explain the basic c syntax for creating a class. include an explanation of the private and public section of a class

  Eax contains the given contents before the instruction

For each add instruction in this problem, assume that EAX contains the given contents before the instruction is executed, and give the contents of EAX as well as the values of the CF, OF, SF, and ZF flags after the instruction is executed:

  Develop a graphical user interface

For this assignment, you are required to develop a Graphical User Interface (GUI) Java Program to demonstrate you can use Java constructs including input/output via a GUI.

  Application for an animal-fur trimming service

Create an application for an animal-fur trimming service. Write the code for the application. Prompt the user to indicate how many animals. Display the total fee for one year. Be pleasant in your output as it will be expensive.

  Mvc pattern and servlet

When you use the MVC pattern, the controller directs the flow of control to

  This assignment will focus on creating java servlets that

this assignment will focus on creating java servlets that can not only serve html to web users but also provide a web

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