logo Use SA10RAM to get 10%* Discount.
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Rameshwar DassHistory
(5/5)

644 Answers

Hire Me
expert
Paramjeet KaurManagement
(5/5)

848 Answers

Hire Me
expert
Adam CooperrFinance
(5/5)

616 Answers

Hire Me
expert
Arjit SinghEngineering
(5/5)

887 Answers

Hire Me
Python Programming

Noughts and Crosses In this two player game, each player takes it in turn to place a chosen mark “symbol” (for example: X or O)

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

NOUGHTS AND CROSSES

In this two player game, each player takes it in turn to place a chosen mark “symbol” (for example: X or O) into one of the empty spaces in a grid by choosing the number of row and column of that empty space. The first player who gets three of his/her symbols in a line horizontally, vertically or diagonally wins the game. If the whole grid was populated by the two player’s symbols, there will be no winner.


You’ll need to use a two dimensional list in this program to present the grid, let the size of the grid to be 4x4. The grid will be initialized with underscores ‘_’ for all the 16 values as shown below.



1  2  3  4

-------------

1|   _  _  _ _

2|   _  _  _ _

3|   _  _  _ _

4|   _  _  _ _


At the beginning, let each player enter his/her name and the mark (symbol) he/she choose to play with. After that, they will take turns to choose the location in the grid to place his/her symbol.

Details:

After each player choose the position to put his/her symbol. The following need to be checked.

1- Has the location been populated or not? If yes, ask the player to choose another location. 2- If the location has not been populated, check if the current player is a winner or not.

  • The game will be kept going until one of the players win or until the grid will be fully populated by the symbols of the 2 players

  • At the beginning of the game and after each player complete entering his/her name and symbol, the empty grid should be printed

  • At the end of each player turn, the new grid need to be printed




Technical requirements:

  • Create a function to check if a player is winner or

 

  • The project must have a two dimensional list initialized as shown previously. 3- Exception handling must be involved in the

  • No need to ask the players if they want to play again

  • Make sure to choose conventional names for the variables, functions and




Output sample

 

Enter Player 1 name: Adam Enter Player 2 name: Ali Enter Player 1 symbol: x Enter Player 2 symbol: o

_ _ _ _

_ _ _ _

_ _ _ _

_ _ _ _ Adam's turn:

Enter the row number [1 to 4]1 Enter the column number [1 to 4]1 x _ _ _

_ _ _ _

_ _ _ _

_ _ _ _ Ali's turn:

Enter the row number [1 to 4]2 Enter the column number [1 to 4]2 x _ _ _

_ o _ _

_ _ _ _

_ _ _ _

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. This  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme

Get Free Quote!

268 Experts Online