Test  Status  Code Input and Output 

1  Fail 
%TicTacToe
%Demonstration of MultiCall with adaptive response
wins=0;
Pass=0;
for i=1:50 % Computer First; 51100 will be Player First
x=zeros(3);
while true % exit on win or filled board
if i<16 % Up bot
p=find(x==0,1);
elseif i<31 % Down bot
p=find(x==0,1,'last');
else % 31 thru 50 % random bot
found=0;
while ~found
p=floor(9*rand)+1;
if x(p)==0,break;end
end
end
% Implement Computer move and Check for Win
x(p)=1;
wt=x;
wt(wt==2)=0;
win=any([sum(wt) sum(wt,2)' trace(wt) trace(fliplr(wt))]==3);
if win,break;end % Computer Wins on its move
% Draw check Post computer move (9th move)
if sum(x(:))>=13,break;end
% Implement player move and Check for Win
p=tic_tac_toe(x);
p=p(1);
if x(p)~=0,break;end % Invalid move  Game over
x(p)=2;
wt=x;
wt(wt==1)=0;
win=any([sum(wt) sum(wt,2)' trace(wt) trace(fliplr(wt))]==6);
if win
wins=wins+1;
break;
end % Player Wins on their move
end % gameover while 1:50
end % Games 1:50
% Output wins against Computer first
wins
for i=51:100 % Player First; 51100 Player First
x=zeros(3);
while true % exit on win or filled board
% Implement player move and Check for Win
p=tic_tac_toe(x);
p=p(1);
if x(p)~=0,break;end % Invalid move  Game over
x(p)=2;
wt=x;
wt(wt==1)=0;
win=any([sum(wt) sum(wt,2)' trace(wt) trace(fliplr(wt))]==6);
if win
wins=wins+1;
break;
end % Player Wins on their move
% Draw check Post computer move (9th move)
if sum(x(:))>=13,break;end
if i<66 % Up bot
p=find(x==0,1);
elseif i<81 % Down bot
p=find(x==0,1,'last');
else % 31 thru 50 % random bot
found=0;
while ~found
p=floor(9*rand)+1;
if x(p)==0,break;end
end
end
% Implement Computer move and Check for Win
x(p)=1;
wt=x;
wt(wt==2)=0;
win=any([sum(wt) sum(wt,2)' trace(wt) trace(fliplr(wt))]==3);
if win,break;end % Computer Wins on its move
end % gameover while 51:100
end % Games 51:100
wins
if wins>65,Pass=1;end
assert(isequal(Pass,1))
horizontal =
1
4
7
p =
2
horizontal =
1
4
7
horizontal =
1
4
7
p =
2
horizontal =
1
4
7
horizontal =
1
4
7
p =
2
horizontal =
1
4
7
horizontal =
1
4
7
p =
2
horizontal =
1
4
7
horizontal =
1
4
7
p =
2
horizontal =
1
4
7
horizontal =
1
4
7
p =
2
horizontal =
1
4
7
horizontal =
1
4
7
p =
2
horizontal =
1
4
7
horizontal =
1
4
7
p =
2
horizontal =
1
4
7
horizontal =
1
4
7
p =
2
horizontal =
1
4
7
horizontal =
1
4
7
p =
2
horizontal =
1
4
7
horizontal =
1
4
7
p =
2
horizontal =
1
4
7
horizontal =
1
4
7
p =
2
horizontal =
1
4
7
horizontal =
1
4
7
p =
2
horizontal =
1
4
7
horizontal =
1
4
7
p =
2
horizontal =
1
4
7
horizontal =
1
4
7
p =
2
horizontal =
1
4
7
horizontal =
1
4
7

Find the two most distant points
1318 Solvers
Project Euler: Problem 1, Multiples of 3 and 5
1117 Solvers
Similar Triangles  find the height of the tree
161 Solvers
Matrix with different incremental runs
208 Solvers
Celsius to Fahrenheit converter
288 Solvers