Displays the contents of the board array

Assignment Help Programming Languages
Reference no: EM131298852

Design a program that allows two players to play a game of tic tac toe. Use a two dimensional Stringarray with three rows 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:

Displays the contents of the board array.

Allows player 1 to select a location on the board for an X. The program should ask the user to enter the row and column number (or can use another suitable method for move selection).

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 (or can use another suitable method for move selection).

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

Player 1 wins when there are three X's in a row on the game board. Player 2 wins when there are three O's in a row on the game board. The winning X's or O's can appear in a row, 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: EM131298852

Questions Cloud

Nonpecuniary cost of legislation : Based on this information, what would be the nonpecuniary cost of legislation that would place a $1.50 cap on the fees banks can charge for noncustomer transactions?
Read the table of contents of the two books : Read the table of contents of the two books, Simulation of Communication Systems by Jeruchim, Balaban, and Shanmugan, and Simulation Techniques by Gardner and Baker.
Recreational marijuana in colorado : What are the economic impacts of recreational marijuana in Colorado?
What is the labor-force participation rate : Suppose instead that 30 million jobs are created, attracting 20 million new people into the labor force. What would be the new rates for labor-force participation and unemployment?
Displays the contents of the board array : Displays the contents of the board array. Allows player 1 to select a location on the board for an X. The program should ask the user to enter the row and column number (or can use another suitable method for move selection).
Summarize given tutorial articles dealing with simulation : Read and summarize the following tutorial articles dealing with simulation:-  W. H. Tranter and K. L. Kosbar, "Simulation of Communication Systems," IEEE Communications Magazine, July 1994, pp. 26-36.
What will happen to per capita gdp : What is the labor-force participation rate in Adirolf?For questions c through f: assume that 15 million Adirolfian homemakers begin seeking jobs and that 10 million find jobs.
Efficiency of tax system and the equity of tax system : Analyze the difference between the efficiency of a tax system and the equity of a tax system as it refers to the costs imposed on taxpayers using the benefits principles.
Evaluate a budgeting system at any governmental level : Evaluate a budgeting system at any governmental level. Analyze the scope and sequence of budgeting in terms of sources of revenues, purpose of government expenditures, budget cycles, budget preparation, and debt administration

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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