image thumbnail
from Cohesion Adhesion Balls by Krishna Lalith
Player having the last move wins the game.

Board(C_A_B,Box)
%drawing the board
function Board(C_A_B,Box)

clf
for ii=1:3
    for jj=1:3
        rectangle('Position', [0+ii 0+jj 1 1],'linewidth',3);        
        hold on
        if Box(ii,jj)==1
            Xcir=(0.5+ii)+0.4*cos(0:1/50:2*pi);
            Ycir=(0.5+jj)+0.4*sin(0:1/50:2*pi);
            plot(Xcir,Ycir);       
            if C_A_B(ii,jj)==1   fill(Xcir,Ycir,'y');   end
            if C_A_B(ii,jj)==2   fill(Xcir,Ycir,'g');   end 
            if C_A_B(ii,jj)==3   fill(Xcir,Ycir,'m');   end
            if C_A_B(ii,jj)==4   fill(Xcir,Ycir,'r');   end
        end        
    end   
end

text(0.85,0.85,'Red > Magenta > Green > Yellow','color','k','fontsize',15);
text(3.15,0.85,'Right click to exit','color','r','fontsize',13);
axis off
title('Cohesion Adhesion Balls','fontsize',20,'color','w');
%--------------------------------------------------------------------------

Contact us at files@mathworks.com