Question: This problem uses MATLAB code. Requiring to create a function. 2. (30 pts) Tic-Tac-Toe. You are not creating the whole game. For this assignment you

This problem uses MATLAB code. Requiring to create a function.  This problem uses MATLAB code. Requiring to create a function. 2.

2. (30 pts) Tic-Tac-Toe. You are not creating the whole game. For this assignment you will write a programmer-defined function that can check the status of the game. Name your function checkWin. The input for the function is a 3by3 array of Os, 1s, and 2s, where 0 means blank, 1 means cross and 2 means circle. The output of the function is a number that may take values of 0, 1, or 2, where 0 means no winner, 1 means cross wins (makes a line), and 2 means circle wins (makes a line). Caution: avoid hardcoding!!! When you have a matrix this small(3x3) things can be done with hardcoding but it will cost you points. function winner checkWin(gameGrid) 2 0 0 2 output is 0, no winner. Output is 1, player1 makes a line

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!