Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone help me do this assignment?! It is about Tic Tac Toe. Thanks!! Part 2 The questious in teis part of the assignimest il!

Can someone help me do this assignment?!
It is about Tic Tac Toe.
Thanks!! image text in transcribed
image text in transcribed
image text in transcribed
Part 2 The questious in teis part of the assignimest il! be groded Question 1: Tic Tac Toe (100 points Before starting this question, we strongly recommend that you complete the warm-up ex- ercises if you have not already done so. These warm-up questions will be the best way to start the assignnent. This assignment should be solved without the use of OOP concepts In particular, all the methods ms be static, and all the variables mast be local For this question, you will write a program called TicTacToe that allous a ser to play Tic Tw Toe against an Al (the compater). You can assume that the user plays using the symbol 'x', while the Al uses the syabol 'o (the lower case vowel, please do not use a zero or the upper case vowel instead). To do so, write (at a minimnm) the following methods. You can write any additional helper method if you wat to. A. A method called createBoard that takes as input one integer n, representing the dimension of the board, and returns an n by n array of characters. This 2 dimensional array of characters represents the board of the gaane. When the board is created, it should be completely empty. To represent this, the elements of the array shoukl all be initialized with the space character For example, createBoard(3) should return a reference to the following array: B. A method called dioplayBoard that takes a 2 dimensional array of character as input and prints out the board. Below is an example of how an empty 4 by 4 board might look like when printed out Consider the array of then dieplayBoard(a) should print: character a-{('x',' l lol Ixlol C. A method ealed writedaBoard that takes as input the board (a 2 dimensional array of character), the character to write, and two integers x and y represetting the position on the board where the character shoukd be written on. Assume that the finst integer indicates the row, and the socond integer indicates the colann. Then, a cell on a board of dimension n is represented by the coordinates (x,y) where x and y are integers between 0 and-1. The method should first verify that the inputs received are valid: if the coordinates received represent a cell outside of the board or if the cell already contain a character that is not the space character, then throw an Page 4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2019 Wurzburg Germany September 16 20 2019 Proceedings Part 2 Lnai 11907

Authors: Ulf Brefeld ,Elisa Fromont ,Andreas Hotho ,Arno Knobbe ,Marloes Maathuis ,Celine Robardet

1st Edition

3030461467, 978-3030461461

More Books

Students also viewed these Databases questions

Question

At what level(s) was this OD intervention scoped?

Answered: 1 week ago

Question

107 MA ammeter 56 resistor ? V voltmeter

Answered: 1 week ago

Question

Generally If Drug A is an inducer of Drug B , Drug B levels will

Answered: 1 week ago

Question

4. Evaluation is ongoing and used to improve the system.

Answered: 1 week ago

Question

6. Effectively perform the managers role in career management.

Answered: 1 week ago