image thumbnail
from Clock Bell by Krishna Lalith
Place the coins on turn basis, on the board to complete &/or to block to gain different medals.

[win]=Check_Status()
function [win]=Check_Status()

global Clock UMedal CMedal Utime Ctime UScore CScore;

win=0;

%# of Medals
if (length(UMedal)>10 || length(CMedal)>10),
    win=1;
end

%Time Limit
if (Utime<=0 || Ctime<=0),
    win=1;
end

%# of Coins
if (length(find(Clock==0))>=15 && length(find(Clock==1))>=15),
    win=1;
end

%Score
if (UScore>450 || CScore>450),
    win=1;
end  

Contact us at files@mathworks.com