感谢世外苏子恒同学提供
uses crt;
var
x,y,xd,yd:shortint;
procedure intro;
begin
clrscr;
writeln;
writeln;
writeln;
writeln;
writeln;
writeln('Naughty ball':46);
writeln('--by suziheng':55);
writeln;
writeln;
writeln('Press CTRL+C to exit the program.':57);
writeln;
writeln;
writeln('Press Enter to start the program.':57);
readln;
end;
begin
xd:=1;
yd:=1;
x:=2;
y:=2;
intro;
cursoroff;
while true do begin
x:=x+xd;
y:=y+yd;
clrscr;
gotoxy(x,y);
write('O');
delay(100);
if (x=80) or (x=1) then xd:=-xd;
if (y=25) or (y=1) then yd:=-yd;
end;
end.