Design program that allow player to play game of tic-tac-toe

Assignment Help Programming Languages
Reference no: EM131119475

Tic-Tac-Toe Game

Design a program that allows two players to play a game of tic-tac-toe. Use a two dimensional String array with three row and three columns as the game board. Each element of the array should be initialized with an asterisk (*). The program should run a loop that does the following;

a. Displays the contents of the board array.

b. Allows player 1 to select a location on the board for an X. The program should ask the user to enter a row and column number.

c. Allows player 2 to select a location on the board for an O. The program should ask the user to enter the row and column number.

d. Determines whether a player has won or if a tie has occurred. If a player has won, the program should declare that player the winner and end. If a tie has occurred, the program should say so and end.

e. Player 1 wins when there are three Xs in a row on the game board. Player 2 wins when there are three Os in a row on the game board. The winning Xs or Os can appear in a row, a column, or diagonally across the board. A tie occurs when all of the locations on the board are full, but there is no winner.

Reference no: EM131119475

Questions Cloud

How would you classify the estimated sales returns stemming : Does the proposed plan achieve the goals of increasing the current ratio and decreasing the debt to equity ratio?
Explain why these social responsibility activities : It has been argued that shareholder wealth maximization is not a realistic normative goal for the firm, given the social responsibility activities that the firm is “expected” to engage in (such as contributing to the arts, education, etc.). Explain w..
Determine your approach would not work for every country : Propose one strategic idea that could launch a regionally famous American product into the global market. Provide two examples to support your idea, and determine whether your approach would or would not work for every country. Support your respon..
Analyzing results of a marketing strategy : Please answer the following questions in a 3-5 page paper (include additional title and references pages) and include APA format and citation style with accompanying references:
Design program that allow player to play game of tic-tac-toe : Design a program that allows two players to play a game of tic-tac-toe. Use a two dimensional String array with three row and three columns as the game board.
Is the shareholder wealth maximization goal a short or long : Is the shareholder wealth maximization goal a short- or long-term goal? Explain your answer.
How many days before the hurricane arrives : Imagine a Category 5 strength hurricane is heading toward Long Island in New York. How many days before the hurricane arrives must the mandatory evacuation order be issued so that all of the people are able to get off the island?
Can corporate morality be practical : An organization's goals often include being a good corporate citizen by emphasizing ethical and socially responsible decisions and actions. What happens when an organization's values are continually on public display? What are the ethical implication..
Discuss the accounting alternatives that should be considere : Discuss the accounting alternatives that should be considered by Griseta & Dubel Inc. for the recognition of its revenues and related expenses.

Reviews

Write a Review

Programming Languages Questions & Answers

  Create a program that asks the user for the values of x and

in engineering thermodynamics it is sometimes necessary to balance chemical reaction equations specifically for the

  Construct a finite state machine m that accepts

Construct a finite state machine M that accepts these variables, constants, assignment operators and others, as well as all the reserved words for this primitive programming language that you are defined in Problem 1.

  Prepare a computer program to simulate the traffic

Write a computer program to simulate the traffic on a 2D plane under different traffic light control schemes.

  Values of variables of logical section of the pseudocode

What are the values of variables a, b, and c after each line of code of each logical section of the pseudocode. Show why the logical section is running.

  Write program to use text file to create relative file

Write a program that uses the text file to create a corresponding relative file. Translate the stock code to an appropriate relative record address.

  What is a recursive function

I have a question related to a recursive function. I have ran it and got it to do what it is supposed to. However, I don't fully understand how it is actually working and how it gets the answer

  Create a form using the form tool

Courtyard Medical Plaza wants to add a form and a report to its database. To ensure consistency, the starting file is provided for you. Create a blank form and modify the form in Layout view.

  Statement to read variables of type double

Suppose two variables p1 and p2 of type POINT, with two fields, x and y, both of type double, have been declared. Write a statement that reads values for p1 and p2 in that order.

  Design main driver class to instantiate-compute sum-objects

Design a main driver class to instantiate and calculate sum of several MonetaryCoin objects. Demonstrate that monetary coin inherits its parent's ability to be flipped.

  Design a pseudo code to create the program

Design a pseudo code to create, debug and execute the program. The documentation should include your name, course, program name, due date, programming language used

  Write a program that inputs an integer in the range

Write a program that inputs an integer in the range [-32767, 32767] from the Serial Monitor and checks to see if that number is a prime number. If the number is a prime number, have the LED on pin 13 turn on. If not, then turn the LED off.

  Logic for a program that performs arithmetic functions

Create the logic for a program that performs arithmetic functions. Design the program to contain two numeric variables. Prompt the user for values for the variables

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