Write an interactive program that plays tic-tac-toe

Assignment Help Computer Engineering
Reference no: EM131857377

Problem

Write an interactive program that plays tic-tac-toe. Represent the board as a three-by-three character array. Initialize the array to blanks and ask each player in turn to input a position. The first player's position will be marked on the board with an O, and the second player's position will be marked with an X. Continue the process until a player wins or the game is a draw. To win, a player must have three marks in a row, in a column, or on a diagonal. A draw occurs when the board is full and no one has won. Input each player's position in the form of an index into the tic-tac-toe board; that is, a row number, space, and column number. Make the program user friendly. After each game, print out a diagram of the board showing the ending positions. Keep a count of the number of games each player has won and the number of draws. Before the beginning of each game, ask each player whether he or she wishes to continue. If either player wishes to quit, print out the statistics and stop.

Reference no: EM131857377

Questions Cloud

Healthcare center in a major american city : You have just opened a healthcare center in a major American city. You have a handful of employees and your main business is to provide
Which is more effective in motivation of salespeople : "It depends!" That's the most common response to the question, "which is more effective in motivation of salespeople, money or recognition?
Define the term progressive disciplinary plan : Managers share responsibility for employee performance and have an active role to play in the performance management cycle.
What are some of the public services : What are some of the public services you find in the open API directory, and how could they be used in data analytics?
Write an interactive program that plays tic-tac-toe : Write an interactive program that plays tic-tac-toe. Represent the board as a three-by-three character array.
Cyberspace or cybersecurity related risks : Develop a list of 5 or more specific cyberspace or cybersecurity related risks which the company included in its report investors.
How would you use inductive reasoning in decision-making : As a manager, when and how would you use inductive and deductive reasoning in decision-making?
Causing the death of someone else : What would be an example of a situation where a person could be sentenced to death for their involvement in causing the death of someone else?
Determine whether or not any two consecutive lines typed : Design and implement an Ada program to determine whether or not any two consecutive lines typed at the keyboard are anagrams of one another.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Provide a diagram of how the three sites interconnected

Servers, domain controllers and printer addresses should be statically assigned while clients/tablets will be DHCP-based

  Evaluate friction coefficients for a laminar boundary layer

For air as a working substance and using the actual tabulated properties, compare the recommended temperature ratio and reference property schemes.

  Which will create a lookup field

Which of the following will create a lookup field, populate the values in the field, and establish relationships between tables?

  Write a program that plays a game called catch-the-creature

Write a program that plays a game called Catch-the-Creature. Use an image to represent the creature. Have the creature appear at a random location for a random.

  Define multimedia sites that include audio and video

In the early 1990s, the Internet offered primarily text-based sites. Now Internet is rich in multimedia sites that include audio and video. What are some of the changes that needed to happen to the Internet in order to support this new functionalit..

  Design a circuit that can divide two two-bit numbers

Design a circuit that can divide two 2-bit numbers using a 4-16 decoder (74154) and any other necessary logic gates. The circuit has two 2-bit inputs A1A2.

  Create any additional data or functions you are suggested

But if you want to create any additional data or functions, you are suggested to put all the created data or functions inside the SolutionSearch class.

  The economic analysis carried out during project

1 what are some sources of risk in a systems analysis and design project and how does a project manager cope with risk

  Explain the von neumann architecture and describe why it is

computer architecture is the combination of software and hardware that is organized in such a fashion as to deliver the

  How will you explain how arrays are used

If you were explaining an array ti a friend who is learning Java. how will you do so?

  Draw the radix search tree

Draw the radix search tree that results when the keys E AS Y Q U E S T I O N are inserted in that order into an initially empty tree.

  What are the ethical implications of it system use locate

what are the ethical implications of it system use? locate an ethical situation you are familiar with or that you have

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