% Filename: TTTWhoGoesFirst.m % Description: % Inputs: % Outputs: % Team DATT "All DATT and den sum." % 11/17/05 %O = 1 comp %X = -1 human %computer = 'o' %human = 'x' MainBoard = [0,0,0;0,0,0;0,0,0] if sum(MainBoard(:,1) == 3 | sum(MainBoard(:,1)) == -3 %call the figure YOU WIN! [1,0,0;0,0,0;0,0,0] %New Game has been started WhoGoesFirst = menu('Who will pick first?','Human','Computer') if WhoGoesFirst == 2 computer = 'x'; %Computer Move %call function for computer move end %Wait for Human Move %while not game over %computer move %human move %end %game is now over %call game_is_over function and record results (displays results) %end script