我有这行代码
GAMBAR;
SETBKCOLOR(15);
BINTANG(17,0,23,12,23,12,36,12,0,12,13,12,36,12,26,21,26,21,29,34,29,34,18,27,18,27,7,34,7,34,10,21,10,21,0,12,0,12,13,12,13,12,17,0,2);
READLN;
FOR I:= 1 TO 20 DO
BEGIN
SKALA(17,0,23,12,23,12,36,12,0,12,13,12,36,12,26,21,26,21,29,34,29,34,18,27,18,27,7,34,7,34,10,21,10,21,0,12,0,12,13,12,13,12,17,0,2,I,I,XA,YA,XB,YB,XC,YC,XD,YD,XE,YE,XF,XG,XH,XI,XJ,W);
BINTANG(XA,YA,XB,YB,XC,YC,XD,YD,XE,YE,XF,XG,XH,XI,XJ,W);
DELAY(500);
END;
READLN;
CLOSEGRAPH;
END.
但是 Turbo Pascal 给出错误“行长”
所以我试着这样做
GAMBAR;
SETBKCOLOR(15);
BINTANG(17,0,23,12,23,12,36,12,0,12,13,12,36,
12,26,21,26,21,29,34,29,34,18,27,18,27,7,
34,7,34,10,21,10,21,0,12,0,12,13,12,13,12,17,0,2);
READLN;
FOR I:= 1 TO 20 DO
BEGIN
SKALA(17,0,23,12,23,12,36,12,0,12,13,12,36,12,26,21,26,21,29,
34,29,34,18,27,18,27,7,34,7,34,10,21,10,21,0,12,0
,12,13,12,13,12,17,0,2,I,I,XA,YA,XB,YB,XC,YC,XD,YD,XE,YE,XF,XG,XH,XI,XJ,W);
BINTANG(XA,YA,XB,YB,XC,YC,XD,YD,XE,YE,XF,XG,XH,XI,XJ,W);
DELAY(500);
END;
READLN;
CLOSEGRAPH;
END.
但是turbo Pascal给出了错误89:“)”预期。
我在谷歌上搜索了这个,但我一无所获。
那么,如何在 turbo pascal 中解决此代码?
此完整视图代码:
VAR GD,GM,XA,YA,XB,YB,W,I:INTEGER;
PROCEDURE GAMBAR;
BEGIN
GD:=VGA;
GM:=VGAHI;
INITGRAPH(GD,GM,'D:\TP\BGI');
END;
PROCEDURE BINTANG(X0,Y0,X1,Y1,X2,Y2,X3,Y3,X4,Y4,X5,X6,X7,X8,X9,C:INTEGER);
BEGIN
SETCOLOR(C);
LINE(X0,Y0,X1,Y1);
LINE(X1,Y1,X2,Y1);
LINE(X2,Y1,X3,Y2);
LINE(X3,Y2,X4,Y3);
LINE(X4,Y3,X5,Y4);
LINE(X5,Y4,X6,Y3);
LINE(X6,Y3,X7,Y2);
LINE(X7,Y2,X8,Y1);
LINE(X8,Y1,X9,Y1);
LINE(X9,Y1,X0,Y0);
END;
PROCEDURE SKALA(X0,Y0,X1,Y1,X2,Y2,X3,Y3,X4,Y4,X5,X6,X7,X8,X9,C,SX,SY:INTEGER;
VAR XA,YA,XB,YB,XC,YC,XD,YD,XE,YE,XF,XG,XH,XI,XJ,W:INTEGER);
BEGIN
XA:=X0*SX;
YA:=Y0*SY;
XB:=X1*SX;
YB:=Y1*SY;
XC:=X2*SX;
YC:=Y2*SY;
XD:=X3*SY;
YD:=Y3*SY;
XE:=X4*SY;
YE:=Y4*SY;
XF:=X5*SY;
XG:=X6*SY;
XH:=X7*SY;
XI:=X8*SY;
XJ:=X9*SY;
W:=C+2;
END;
{PROGRAM UTAMA}
BEGIN
GAMBAR;
SETBKCOLOR(15);
BINTANG(17,0,23,12,23,12,36,12,0,12,13,12,36,12,26,21,26,21,29,34,29,34,18,27,18,27,7,34,7,34,10,21,10,21,0,12,0,12,13,12,13,12,17,0,2);
READLN;
FOR I:= 1 TO 20 DO
BEGIN
SKALA(17,0,23,12,23,12,36,12,0,12,13,12,36,12,26,21,26,21,29,34,29,34,18,27,18,27,7,34,7,34,10,21,10,21,0,12,0,12,13,12,13,12,17,0,2,I,I,XA,YA,XB,YB,XC,YC,XD,YD,XE,YE,XF,XG,XH,XI,XJ,W);
BINTANG(XA,YA,XB,YB,XC,YC,XD,YD,XE,YE,XF,XG,XH,XI,XJ,W);
DELAY(500);
END;
READLN;
CLOSEGRAPH;
END.
感谢...