100% MATLAB prog సుడొకు తయారీ
clc
clear all
modalu=ceil(rand*9) %to geerate a integer in the range [1, 9]
suDoku_v= zeros(9,9);
for i=1:3
for j=1:9
tatkal=modalu+(3*(i-1))+j-1;
suDoku_v(i,j)= tatkal;
while(suDoku_v(i,j)>9)
suDoku_v(i,j)=suDoku_v(i,j)-9;
end
end
end
for k=1:3
suDoku_v(3+k,:)=circshift(suDoku_v(k,:),-1); %left shifting kth row by 1 unit to get (3+k)th row
suDoku_v(6+k,:)=circshift(suDoku_v(k,:),-2);
end
suDoku_v
clear all
modalu=ceil(rand*9) %to geerate a integer in the range [1, 9]
suDoku_v= zeros(9,9);
for i=1:3
for j=1:9
tatkal=modalu+(3*(i-1))+j-1;
suDoku_v(i,j)= tatkal;
while(suDoku_v(i,j)>9)
suDoku_v(i,j)=suDoku_v(i,j)-9;
end
end
end
for k=1:3
suDoku_v(3+k,:)=circshift(suDoku_v(k,:),-1); %left shifting kth row by 1 unit to get (3+k)th row
suDoku_v(6+k,:)=circshift(suDoku_v(k,:),-2);
end
suDoku_v
modalu = 7 suDoku_v = 7 8 9 1 2 3 4 5 6 1 2 3 4 5 6 7 8 9 4 5 6 7 8 9 1 2 3 8 9 1 2 3 4 5 6 7 2 3 4 5 6 7 8 9 1 5 6 7 8 9 1 2 3 4 9 1 2 3 4 5 6 7 8 3 4 5 6 7 8 9 1 2 6 7 8 9 1 2 3 4 5
కామెంట్లు
కామెంట్ను పోస్ట్ చేయండి
దయచేసి మీ సలహాలను సూచనలను స్పష్టంగా పేర్కొనగలరు. plz see that ur comments are 'acceptable' in a value based society.