(Solved) : Noughts Crosses Two Player Game Player Takes Turn Place Chosen Mark Symbol Example X O One Q41386325 . . .

NOUGHTS AND CROSSES

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

You’ll need to use a two dimensional list in this program topresent the grid, let the size of the grid to be 4×4. The grid willbe initialized with underscores ‘_’ for all the 16 values as shownbelow.

1 2 3 4

————-

1| _ _ _ _

2| _ _ _ _

3| _ _ _ _

4| _ _ _ _

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

Details:

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

Has the location been populated or not? If yes, ask the playerto choose another location.

If the location has not been populated, check if the currentplayer is a winner or not.

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

At the beginning of the game and after each player completeentering his/her name and symbol, the empty grid should beprinted.

At the end of each player turn, the new grid need to beprinted.

Technical requirements:

Create a function to check if a player is winner or not.

The project must have a two dimensional list initialized asshown previously.

Exception handling must be involved in the project.

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

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

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 _ _

_ _ _ _

_ _ _ _

Adam’s turn:

Enter the row number [1 to 4]3

Enter the column number [1 to 4]3

x _ _ _

_ o _ _

_ _ x _

_ _ _ _

Ali’s turn:

Enter the row number [1 to 4]4

Enter the column number [1 to 4]4

x _ _ _

_ o _ _

_ _ x _

_ _ _ o

Adam’s turn:

Enter the row number [1 to 4] 2

Enter the column number [1 to 4] 2

The chosen location is populated, please try again.

Enter the row number [1 to 4]2

Enter the column number [1 to 4]1

x _ _ _

x o _ _

_ _ x _

_ _ _ o

Ali’s turn:

Enter the row number [1 to 4]1

Enter the column number [1 to 4]2

x o _ _

x o _ _

_ _ x _

_ _ _ o

Adam’s turn:

Enter the row number [1 to 4]1

Enter the column number [1 to 4]3

x o x _

x o _ _

_ _ x _

_ _ _ o

Ali’s turn:

Enter the row number [1 to 4]1

Enter the column number [1 to 4]4

x o x o

x o _ _

_ _ x _

_ _ _ o

Adam’s turn:

Enter the row number [1 to 4]2

Enter the column number [1 to 4]4

x o x o

x o _ x

_ _ x _

_ _ _ o

Ali’s turn:

Enter the row number [1 to 4]2

Enter the column number [1 to 4]3

x o x o

x o o x

_ _ x _

_ _ _ o

Adam’s turn:

Enter the row number [1 to 4]3

Enter the column number [1 to 4]2

x o x o

x o o x

_ x x _

_ _ _ o

Ali’s turn:

Enter the row number [1 to 4]3

Enter the column number [1 to 4]1

x o x o

x o o x

o x x _

_ _ _ o

Adam’s turn:

Enter the row number [1 to 4]4

Enter the column number [1 to 4]1

x o x o

x o o x

o x x _

x _ _ o

Ali’s turn:

Enter the row number [1 to 4]4

Enter the column number [1 to 4]2

x o x o

x o o x

o x x x

x o _ o

Expert Answer


Answer to NOUGHTS AND CROSSES In this two player game, each player takes it in turn to place a chosen mark “symbol” (for examp…