Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Lab 9: A Game for Hoan Directions: A student thought that his computer science class was boring and ssked his teachet to incorporate games to
Lab 9: A Game for Hoan Directions: A student thought that his computer science class was boring and ssked his teachet to incorporate games to the clnss. In this lab, you are going to program a simple Tle-Tac-Toe game in Java. You are provided with a skeleton of the class on MyDJO and you are to fill in the following methods: 1. int getMova() Asks the user to enter a string of charucters representing the coordinate where storing the row and column. For they wish to place their letter, returns an array of length 2 instance, 30 will return the array (3,0 .If the space is already occupied by something other than an asteriak, it should tell this to the .If characters other than 0 through 9 are in the string, it should tell the user to input only 09 .If the string has more than two characters (e g. 351), it should display an error message and If they enter & location not on the board (e.g. a board of side length 4 and the player enters user and ask them for another location. and ask for their location again. ask for their choice again 83), it should display an error message and ask for their choice again. 2. boolean detectNin) checks horizNin), vertuin), and diagkin), if one of thern is true, 3. boolean horizwin() Detects a horizontal win (a full row of X's or a full row of D's), returns 4. boolean vertWin) Detects a vertical win (a full column of X's or a full column of D's), returns 5. boolean diagWin() Detects a diagonal win (top left to bottom right OR top right to bottom returns true. Otherwise, returns false. true if detected, false otherwise. true if detected, talse otherwise. left), returns true if detected, talse otherwise. Notes . You may work in groups of 2-3 for this lab (or you can work alone, if you prefer), but full partici- . You are also provided with a test method which will help you determine if your detectkin) . Aside from adding the necessary code wherever you see /. IMPLENENTATION NOT SHOWN , you . Your class must begin with the standard comment block that we have been using all year pation is expected from all method is working or not (though you may wish to test more cases than I have provided you with). may not change any of the code that you are provided with for any of the methods
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started