function []=karmap1(k) n=4; k(:,:,2)=zeros(n,n); var=['y' 'z' 'w' 'x']; p1=['y''z''' 'y''z' 'yz' 'yz''']; p2=['w''x''';'w''x';'wx';'wx''']; cmn4=1; cmn2=1; temp=1; //16 cells for i=1:n for j=1:n if(k(i,j)~=1) temp=0; break; end end end if(temp==1) printf("1"); abort; end //8 cells z1=ones(2,4); z2=ones(4,2); temp1=['00' '01' '11' '10']; temp2=temp1'; for i=1:n if(i==4) t=1; else t=i+1; end z=[k(i,:,1);k(t,:,1)]; if(z==z1) k(i,:,2)=[1 1 1 1]; k(t,:,2)=[1 1 1 1]; a=strsplit(temp2(i,1)); b=strsplit(temp2(t,1)); c=strcmp(a,b); for in=1:max(size(c)) if(c(in)==0 & a(in)=='0') printf('%s''',var(in)); disp(""); break; else if(c(in)==0 & a(in)=='1') printf(var(in)); disp(""); break; end end end end end for j=1:n if(j==4) t=1; else t=j+1; end z=[k(:,j,1) k(:,t,1)]; if(z==z2) k(:,j,2)=[1;1;1;1]; k(:,t,2)=[1;1;1;1]; a=strsplit(temp1(1,j)); b=strsplit(temp1(1,t)); c=strcmp(a,b); for in=1:max(size(c)) if(c(in)==0 & a(in)=='0') printf('%s''',var(2+in)); disp(""); break; else if(c(in)==0 & a(in)=='1') printf(var(2+in)); disp(""); break; end end end end end //4 cells z1=ones(1,4); z2=ones(4,1); z3=ones(2,2); temp1=['00' '01' '11' '10']; temp2=temp1'; for t=1:n z=k(t,:,1); no=number_of(k(t,:,2),1); if(z==z1 & no