Implement a game of tic-tac-toe

Assignment Help JAVA Programming
Reference no: EM13698773

Question: Specify, design, and implement a class that can be one player in a Game of tic-tac-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-tac-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 wheit was draw, an X win, or an O win.

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

Can you find the answer and please show me all the working and provide the answer.  

 

Reference no: EM13698773

Questions Cloud

Make an explicit statement of the invariant of the set class : Write 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 will need to change the interface a bit. For example, instead of the bag's count function, you'll want a constant..
Explain the hydrangea flower was also mentioned : Question- In the video CIA Demonstration: Natural Acid-Base Indicators, red cabbage was demonstrated as a natural indicator, and the hydrangea flower was also mentioned.
Energy change for the transport of potassium ions : Question- 1) Calculate the free energy change for the transport of potassium ions from the nerve cells (15mM) to the blood plasma (400mM) at physiological temperatures
What volume of 0.200 m na2co3 solution contains na2co3 : Question- What volume of 0.200 M Na2Co3 (aq) solution contains 53.0 g of Na2Co3 Could you show the steps and equation
Implement a game of tic-tac-toe : Specify, design, and implement a class that can be one player in a Game of tic-tac-toe. The constructor should be specify whether the object is to be the first player (X's) or the second player (O's).
Calculate the nuclear binding energy : Question- Calculate the nuclear binding energy (in J) and the binding energy per nucleon for the following isotope K (39.96400 amu).
Show the closure under difference for regular languages : Show the closure under difference for regular languages but the proof was non-constructive.
Draw both mirror images of fluorochlorobromomethane : Question- Using the recessed bond and protruding bonds, as well as two regular straight-line bonds, draw both mirror images of fluorochlorobromomethane.
Explain what combination of a molecular base : Question- 1) What combination of a molecular base and a salt of the conjugate acid of the molecular base should you select to prepare a buffer solution that would maintain a pH of approximately 9.50. Please Explain.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Explain the inventory program to include an add button

Modify the Inventory Program to include an add button, a delete button, and a modify button on the GUI. These buttons should allow the user to perform the corresponding actions on the item name, the number of units in stock

  Wa program that takes 10 values represent

Using a loop, write a program that takes 10 values represent in exam grades (between 0 and 100) from the keyboard and outputs the minimum value, maximum value, and average value of all the values entered.

  Calculates the product of the following sequence

Write a java code that calculates the product of the following sequence of numbers using for/loop and do/while/loop

  Java socket hello i need to this assignment done in net

hello i need to this assignment done in net beans . and i want comment in code .also screen shots of running program

  Simple java application that uses the string

Create a simple Java application that uses the String class and/or the StringBuffer class and at least 4 of the class methods. Show the code, demonstrate it works properly and describe what it is doing.

  Write an application that uses an array to store

Write an application that uses an Array to store 10 messages of type String - You will store this Array with 10 messages

  Method named isallvowels that returns

Write a method named isAllVowels that returns whether a String consists entirely of vowels (a, e, i, o, or u, case-insensitively). If every character of the String is a vowel, your method should return true. If any character of the String is a non-vo..

  Java-s ability to derive new fonts from existing ones

Find out where on your system these font libraries are located. When you do, please specify the operating system and the location (folder/directory) where you found them. Discuss Java's ability to derive new fonts from existing ones.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Powerful pain reliever are consumers with headaches

Your target market for the most powerful pain reliever are consumers with HEADACHES. Start with goals and objectives. Do a SWOT. What information is most important for your market? Do some market research.

  Write a program that draws a picture of a house

Write a program that draws a picture of a house. It could be as simple as the accompanying figure, or if you like, make it more elaborate

  Note the line number in the statement

Note the line number in the statement

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