Исходная задача:
Код
Uses Crt;
var
x,y:array[1..100] of integer;
N,i:integer;
begin
ClrScr;
n:=4;
randomize;
For i:=1 to N do begin
x[i]:=random(79);
y[i]:=random(50);
end;
Repeat
For i:=1 to N do begin
x[i]:=x[i]+random(3)-1;
y[i]:=y[i]+random(3)-1;
If x[i]>79 Then x[i]:=79;
If y[i]>50 Then x[i]:=50;
If x[i]<1 Then x[i]:=1;
If y[i]<1 Then y[i]:=1;
end;
For i:=1 to N do begin
TextColor(random(3));
GoToXY(x[i],y[i]);
Write('^');
Delay(2500);
ClrScr;
end;
Until KeyPressed;
Readln;
end.
var
x,y:array[1..100] of integer;
N,i:integer;
begin
ClrScr;
n:=4;
randomize;
For i:=1 to N do begin
x[i]:=random(79);
y[i]:=random(50);
end;
Repeat
For i:=1 to N do begin
x[i]:=x[i]+random(3)-1;
y[i]:=y[i]+random(3)-1;
If x[i]>79 Then x[i]:=79;
If y[i]>50 Then x[i]:=50;
If x[i]<1 Then x[i]:=1;
If y[i]<1 Then y[i]:=1;
end;
For i:=1 to N do begin
TextColor(random(3));
GoToXY(x[i],y[i]);
Write('^');
Delay(2500);
ClrScr;
end;
Until KeyPressed;
Readln;
end.
буду очень благодарен за помощь.
Код в теги!