Tuesday, September 3, 2019

Essay --

%tim's tictactoe final project for ENGR 120 computational tools function tttprog() %builds UI screen f = figure('Name','Tic-Tac-Toe','Units','centimeters',... 'Position',[5, 5, 15, 11]); %keeps track of turns - 0:X 1:O global turn turn = 0; %add buttons global b1 b2 b3 b4 b5 b6 b7 b8 b9 b1 = uicontrol(f,'Style','pushbutton','Units','centimeters',... 'Position',[1, 7, 3, 3],'FontSize',36,'Callback',@onPush); b2 = uicontrol(f,'Style','pushbutton','Units','centimeters',... 'Position',[4, 7, 3, 3],'FontSize',36,'Callback',@onPush); b3 = uicontrol(f,'Style','pushbutton','Units','centimeters',... 'Position',[7, 7, 3, 3],'FontSize',36,'Callback',@onPush); b4 = uicontrol(f,'Style','pushbutton','Units','centimeters',... 'Position',[1, 4, 3, 3],'FontSize',36,'Callback',@onPush); b5 = uicontrol(f,'Style','pushbutton','Units','centimeters',... 'Position',[4, 4, 3, 3],'FontSize',36,'Callback',@onPush); b6 = uicontrol(f,'Style','pushbutton','Units','centimeters',... 'Position',[7, 4, 3, 3],'FontSize',36,'Callback',@onPush); b7 = uicontrol(f,'Style','pushbutton','Uni...

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.