image thumbnail

MOO Maker

by

 

A variant of classical "MOO" or "Cows n Bulls" game.

board(handy,varargin)
function board(handy,varargin)

global ghands Guess moomat;

ii=varargin{2};
jj=varargin{3};

switch Guess(jj,ii),
	case '1',  numby=1;
	case '2',  numby=2;
	case '3',  numby=3;
	case '4',  numby=4;
	case '5',  numby=5;
	case '6',  numby=6;    
	case '7',  numby=7;
	case '8',  numby=8;
	case '9',  numby=9;
	case '0',  numby=0;
end
    
Guess(jj,ii)=int2str(mod(1+numby,10));
cdata=imread([Guess(jj,ii),'.tif']);
set(ghands(ii,jj),'cdata',cdata);

counter=4*4;
for ii=1:4,
    for jj=1:4,
        if moomat(ii,jj)==Guess(ii,jj), counter=counter-1; end
    end
end
if counter==0, 
    msg={'You Cracked it...!'};
    [braindata brainmap]=imread('brain.jpg');
    msg_handle=msgbox(msg,'Gotcha!!!...','custom',braindata,brainmap);                        
    pause(1);
    close(msg_handle);
end

Contact us