Question: Im suppose to make a code on MATLAB for a tic tac toe game following those instructions. I need to make user 2 play and

 Im suppose to make a code on MATLAB for a tic

Im suppose to make a code on MATLAB for a tic tac toe game following those instructions. I need to make user 2 play and repeat un til one user wins. and display that there is a tie. function [dtictactoel NUNTITLED3 Summary of this function goes here Detailed explanation goes here IT ts 5 5 55S:55 5] C=input ( ' column ' ) R-input ('zOw' TestOm mn ( (surn (TT) ) , (surn (TT') ) , (TT (11+TT (5)-TT (9) ) , (TT (3) +TT (5) +TT (7) ) ) if Test0=#0 disp('0 win.) Testi-min (abs (sum (TT-1) ) , (3um (TT1) ) , (sum (diag (TT-1) ) ) , (sum (diag (TT. "-1) ) ) ) if Testi--0 disp('1 win' end .1 .5 .6 8-end function [d] = tctactoe %UNTITLED3 Summary of this function goes here % Detailed explanation goes TT[5 5 5; 5 5 5; 5 5 5] X-1; O-0; C-input(column') R-input(row') Test0= min((sum(TT)),(sum(TT)),(Tr( 1 )-TT(5)+TT(9)),(TT(3)+TT(5)+TT(7))) if Test00 disp(0 wIn') Test 1 = min( abs(sum(TT-I )).(sum(TT. I )).(sunn( diag(TT-I ))).(sum (diag(TT.'-1 )))) if Testl=-0 disp('I win') end end

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!