Помогите, плиз, решить задачку:
Символы строки разлетаются в разные стороны.
uses crt;
const
cs = 'Good Bye, klem4 !';
mx = 79 div 2;
my = 24 div 2;
delta : array [0..1] of shortint = (1, -1);
type
TSign = record
x, y : word;
ch : char;
dx,dy : shortint;
end;
var
i, len : byte;
s : array[1..length(cs)] of TSign;
begin
clrscr;
randomize;
len := length(cs);
for i := 1 to len do
with s[i] do begin
ch := cs[i];
x := mx + i - 1 - len div 2;
y := my;
dx := delta[Random(2)];
dy := delta[Random(2)];
gotoxy(x,y);
write(ch);
end;
repeat
delay(1000);
clrscr;
for i := 1 to len do
with s[i] do begin
if (x + dx <= 79) and
(x + dx >= 1) and
(y + dy <= 24) and
(y + dy >= 1) then begin
inc(x, dx);
inc(y, dy);
end;
gotoxy(x, y);
write(ch);
end;
until keypressed;
end.
ch := cs[i];
uses crt;
const
_cs = 'Good Bye, klem4 !';
cs: string = _cs;
mx = 79 div 2;
my = 24 div 2;
delta : array [0..1] of shortint = (1, -1);
type
TSign = record
x, y : word;
ch : char;
dx,dy : shortint;
end;
var
i, len : byte;
s : array[1..length(_cs)] of TSign;
begin
...