Автор работы: Пользователь скрыл имя, 26 Октября 2010 в 17:19, Не определен
Игрушка, созданная на языке Delphi
(b2[m+1,n+2]<>2) and
(b2[m-1,n+2]<>2) and
(b2[m,n+2]<>2) and
(b2[m+1,n+3]<>2) and
(b2[m-1,n+3]<>2) and
(b2[m,n+3]<>2) and
(b2[m,n+3]<>2) then
begin
for i:=0 to 2 do
b2[m,n+i]:=2;
m3:=m3+1
end;
end
end;
8..10:
case m of
1..7: case z of
0: if (b2[m,n]<>2) and
(b2[m+1,n+1]<>2) and
(b2[m,n+1]<>2) and
(b2[m-1,n+1]<>2) and
(b2[m-1,n]<>2)and
(b2[m-1,n-1]<>2)and
(b2[m,n-1]<>2) and
(b2[m+1,n-1]<>2) and
(b2[m+2,n-1]<>2) and
(b2[m+2,n+1]<>2) and
(b2[m+2,n]<>2) and
(b2[m+3,n-1]<>2) and
(b2[m+3,n+1]<>2) and
(b2[m+3,n]<>2) then begin
for i:=0 to 2 do
b2[m+i,n]:=2;
m3:=m3+1
1: if (b2[m,n]<>2) and
(b2[m-1,n-1]<>2) and
(b2[m-1,n]<>2) and
(b2[m-1,n+1]<>2) and
(b2[m,n-1]<>2)and
(b2[m+1,n+1]<>2)and
(b2[m+1,n]<>2) and
(b2[m+1,n-1]<>2) and
(b2[m+1,n-2]<>2) and
(b2[m-1,n-2]<>2) and
(b2[m,n-2]<>2) and
(b2[m+1,n-3]<>2) and
(b2[m-1,n-3]<>2) and
(b2[m,n-3]<>2) then
begin
for i:=0 to 2 do
b2[m,n-i]:=2;
m3:=m3+1
end
end;
8..10: case z of
0: if (b2[m,n]<>2) and
(b2[m-1,n-1]<>2) and
(b2[m-1,n]<>2) and
(b2[m-1,n+1]<>2) and
(b2[m,n-1]<>2)and
(b2[m+1,n+1]<>2)and
(b2[m+1,n]<>2) and
(b2[m+1,n-1]<>2) and
(b2[m+1,n-2]<>2) and
(b2[m-1,n-2]<>2) and
(b2[m,n-2]<>2) and
(b2[m+1,n-3]<>2) and
(b2[m-1,n-3]<>2) and
(b2[m,n-3]<>2) then
begin
for i:=0 to 2 do
b2[m,n-i]:=2;
end;
1: if (b2[m,n]<>2) and
(b2[m+1,n+1]<>2) and
(b2[m,n+1]<>2) and
(b2[m-1,n+1]<>2) and
(b2[m-1,n]<>2)and
(b2[m-1,n-1]<>2)and
(b2[m,n-1]<>2) and
(b2[m+1,n-1]<>2) and
(b2[m-2,n-1]<>2) and
(b2[m-2,n+1]<>2) and
(b2[m-2,n]<>2) and
(b2[m-3,n-1]<>2) and
(b2[m-3,n+1]<>2) and
(b2[m-3,n]<>2) then
begin
for i:=0 to 2 do
b2[m-i,n]:=2;
m3:=m3+1
end
end
end
end
end;
//двухпалубные
while m2<3 do begin
m:=random(10)+1;
n:=random(10)+1;
z:=(random(100)
mod 2);
case n of
1..8:
case m of
1..8: case z of
0: if (b2[m,n]<>2) and
(b2[m-1,n-1]<>2) and
(b2[m-1,n]<>2) and
(b2[m-1,n+1]<>2) and
(b2[m,n-1]<>2)and
(b2[m+1,n+1]<>2)and
(b2[m+1,n]<>2) and
(b2[m+1,n-1]<>2) and
(b2[m,n+1]<>2) and
(b2[m+1,n+2]<>2) and
(b2[m-1,n+2]<>2) and
(b2[m,n+2]<>2) then
begin
for i:=0 to 1 do
b2[m,n+i]:=2;
m2:=m2+1
end;
1: if (b2[m,n]<>2) and
(b2[m+1,n+1]<>2) and
(b2[m,n+1]<>2) and
(b2[m-1,n+1]<>2) and
(b2[m-1,n]<>2)and
(b2[m-1,n-1]<>2)and
(b2[m,n-1]<>2) and
(b2[m+1,n-1]<>2) and
(b2[m+1,n]<>2) and
(b2[m+2,n-1]<>2) and
(b2[m+2,n+1]<>2) and
(b2[m+2,n]<>2) then begin
for i:=0 to 1 do
b2[m+i,n]:=2;
m2:=m2+1
end;
9..10: case z of
0: if (b2[m,n]<>2) and
(b2[m+1,n+1]<>2) and
(b2[m,n+1]<>2) and
(b2[m-1,n+1]<>2) and
(b2[m-1,n]<>2)and
(b2[m-1,n-1]<>2)and
(b2[m,n-1]<>2) and
(b2[m+1,n-1]<>2) and
(b2[m-2,n-1]<>2) and
(b2[m-2,n+1]<>2) and
(b2[m-2,n]<>2) then
begin
for i:=0 to 1 do
b2[m-i,n]:=2;
m2:=m2+1
end;
1: if (b2[m,n]<>2) and
(b2[m-1,n-1]<>2) and
(b2[m-1,n]<>2) and
(b2[m-1,n+1]<>2) and
(b2[m,n-1]<>2)and
(b2[m+1,n+1]<>2)and
(b2[m+1,n]<>2) and
(b2[m+1,n-1]<>2) and
(b2[m,n+1]<>2) and
(b2[m+1,n+2]<>2) and
(b2[m-1,n+2]<>2) and
(b2[m,n+2]<>2) then
begin
for i:=0 to 1 do
b2[m,n+i]:=2;
m2:=m2+1
end;
end
end;
9..10: