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.

Clock_Bell_Board()
function Clock_Bell_Board()

global turn Utimehand Ctimehand Utime Ctime UUUhand CPUhand Score timelimit;
global Upoint Cpoint UMedal CMedal UMedalHand CMedalHand UScore CScore MultiP;
global UScoreadd CScoreadd;
%--------------------------------------------------------------------------
%Medals
%UUU
if ~isempty(UMedal)
    set(UMedalHand(11),'string','');
end

for ii=1:length(UMedal)
    switch UMedal(ii)
        case 1
            set(UMedalHand(ii),'string','\rightarrow');
        case 2
            set(UMedalHand(ii),'string','\leftarrow\rightarrow');
        case 3
            set(UMedalHand(ii),'string','\oslash');
        case 4
            set(UMedalHand(ii),'string','O');
        case 5
            set(UMedalHand(ii),'string','\partial');
        case 6
            set(UMedalHand(ii),'string','\vartheta');
    end
end

%CPU
if ~isempty(CMedal)
    set(CMedalHand(11),'string','');
end

for ii=1:length(CMedal)
    switch CMedal(ii)
        case 1
            set(CMedalHand(ii),'string','\rightarrow');
        case 2
            set(CMedalHand(ii),'string','\leftarrow\rightarrow');
        case 3
            set(CMedalHand(ii),'string','\oslash');
        case 4
            set(CMedalHand(ii),'string','O');
        case 5
            set(CMedalHand(ii),'string','\partial');
        case 6
            set(CMedalHand(ii),'string','\vartheta');
    end
end
%--------------------------------------------------------------------------
if mod(turn,2)==0,
    set(UUUhand,'fontsize',15);
    set(CPUhand,'fontsize',12);
end
if mod(turn,2)==1,   
    set(UUUhand,'fontsize',12);
    set(CPUhand,'fontsize',15);
end

hold on

%Time
set(Utimehand,'string',sprintf('%02.0f : %02.0f',floor(Utime/60),mod(Utime,60)));
set(Ctimehand,'string',sprintf('%02.0f : %02.0f',floor(Ctime/60),mod(Ctime,60)));

%Score pointer
UScore=0;
for ii=1:length(UMedal)
    UScore=UScore+Score(UMedal(ii));
end
if (UScore-MultiP*10*(timelimit-floor(Utime/60)))>0,
    UScore=UScore+UScoreadd-MultiP*10*(timelimit-floor(Utime/60));
end

CScore=0;
for ii=1:length(CMedal)
    CScore=CScore+Score(CMedal(ii));
end
if (CScore-MultiP*10*(timelimit-floor(Ctime/60)))>0,
    CScore=CScore+CScoreadd-MultiP*10*(timelimit-floor(Ctime/60));
end

set(Upoint,'Ydata',[(1+UScore/75) (1+UScore/75)-0.25 (1+UScore/75)+0.25]);
set(Cpoint,'Ydata',[(1+CScore/75) (1+CScore/75)-0.25 (1+CScore/75)+0.25]);

hold off
%--------------------------------------------------------------------------

Contact us at files@mathworks.com