Create a game that displays a three-by-three grid

Assignment Help Computer Engineering
Reference no: EM131851787

Problem

a. Create a TicTacToe game. In this game, two players alternate placing Xs and Os into a grid until one player has three matching symbols in a row, either horizontally, vertically, or diagonally. Create a game that displays a three-by-three grid containing the digits 1 through 9, similar to the first window shown in Figure 8-15. When the user chooses a position by typing a number, place an X in the appropriate spot. For example, after the user chooses 3, the screen looks like the second window in Figure 8-15. Generate a random number for the position where the computer will place an O. Do not allow the player or the computer to place a symbol where one has already been placed. When either the player or computer has three symbols in a row, declare a winner. If all positions have been used and no one has three symbols in a row, declare a tie.

288_TicTacToe game.jpg

b. In the TicTacToe game, the computer's selection is chosen randomly. Improve the game so that when the computer has two Os in any row, column, or diagonal, it selects the winning position for its next move rather than selecting a position randomly.

Reference no: EM131851787

Questions Cloud

What is the probability that exactly four people : What is the probability that exactly four people of this group have the same birthday and that all the others have different birth-days
Discussion on the rate of pay requested : Advise Lim whether to accept the labours' initial offer of working overtime. Support your argument with the Linear Programming Graph.
What is the probability that one will arrive : What is the probability that one will arrive between 1:00 PM. and 1:12 RM., and the other between 1:17 PM. and 1:30 RM.?
Expansion project-requires initial fixed asset investment : Summer Tyme, Inc., is considering a new 3-year expansion project that requires an initial fixed asset investment of $1.458 million.
Create a game that displays a three-by-three grid : Create a game that displays a three-by-three grid containing the digits 1 through 9, similar to the first window shown in Figure 8-15.
Crime investigation six innocent suspects : If during a crime investigation six innocent suspects are examined by the operator, what is the probability that at least one of them is detected as guilty?
Questionnaire to a group of randomly selected people : A social scientist is about to send a questionnaire to a group of randomly selected people. If 30% of the population are younger than 25 and 17%
Observation of the taking of the physical inventory : For what purposes do the auditors make and record test counts of inventory quantities during their observation of the taking of the physical inventory? Discuss.
Make a journal entry for each of the transactions : Please make a journal entry for each of the transactions. Remember that the revenues must be classified as unrestricted, temporarily restricted.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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