1. úkol

Sudoku

Řešení pro obecné p

```p = 2;
p2 = p^2;
p4 = p^4;
p3 = p^3;
B = zeros(p4,p4);

for i=1:p4
sloupec = mod(i,p2);
if(sloupec==0)
sloupec = p2;
end

for u=1:p2
end

%sloupec
for v=1:p2
end

for j=1:p
for g=1:p
pos = sourPrvniBodBunky+((j-1)*p2) + (g-1);
B(i,pos) = 1;
end
end
B(i,i) = 0;

end

g = graphcoloring(g);
prumer = 20;
x = 100;
y = p2*prumer+(p2*10);
krok = 1;

for k=1:p4
g.N(k).Name = '';
g.N(k).graphicParam(1).width = prumer;
g.N(k).graphicParam(1).height = prumer;
g.N(k).graphicParam(1).x = x+(prumer+3)*(krok-1);
g.N(k).graphicParam(1).y = y;
krok=krok+1;
if(mod(k,p2)== 0)
y = y-(prumer*1.25);
krok=1;
end
end

graphedit(g)
graphedit('viewedgesnames', 'off','viewnodesnames', 'off','arrowsvisibility', 'off')

% for i=1:p4
%     %vem 1 radek a vypis po
%     line=0;
%     A = zeros(p2,p2);
%     for j=1:p2
% A(j,:)=    B(i,line+1:line+p2);
%     line = line+p2;
%     end
%     i
%     A
% end
```
courses/a4b35ko/ukol1.txt · Poslední úprava: 2019/01/10 18:46 (upraveno mimo DokuWiki)
Nahoru