INTEGER GETARG,GETLIN,LENGTH,IABS,MOD,ISIGN,GCTOI INTEGER INPUT0(102),OUTPU0(102) INTEGER I,ROTATE,ROTAT0,INLEN IF((GETARG(1,INPUT0,128).NE.-1))GOTO 10000 10001 IF((GETLIN(INPUT0,-10,102).EQ.-1))GOTO 10002 INLEN=LENGTH(INPUT0)-1 I=1 GOTO 10005 10003 I=I+1 10005 IF((I.GT.INLEN))GOTO 10004 OUTPU0(INLEN-I+1)=INPUT0(I) GOTO 10003 10004 OUTPU0(INLEN+1)=0 CALL PUTLIN(OUTPU0,-11) CALL PUTCH(138,-11) GOTO 10001 10002 CALL SWT 10000 I=1 ROTAT0=GCTOI(INPUT0,I,10) 10006 IF((GETLIN(INPUT0,-10,102).EQ.-1))GOTO 10007 INLEN=LENGTH(INPUT0)-1 IF((INLEN.GE.IABS(ROTAT0)))GOTO 10008 ROTATE=ISIGN(MOD(IABS(ROTAT0),INLEN),ROTAT0) GOTO 10009 10008 ROTATE=ROTAT0 10009 IF((ROTATE.LT.0))GOTO 10010 I=1 GOTO 10013 10011 I=I+1 10013 IF((I.GT.INLEN))GOTO 10012 IF((((INLEN-ROTATE)+I).GT.INLEN))GOTO 10014 OUTPU0(I)=INPUT0((INLEN-ROTATE)+I) GOTO 10015 10014 OUTPU0(I)=INPUT0(I-ROTATE) 10015 GOTO 10011 10012 OUTPU0(INLEN+1)=0 GOTO 10016 10010 I=1 GOTO 10019 10017 I=I+1 10019 IF((I.GT.INLEN))GOTO 10018 IF(((INLEN-(INLEN+ROTATE)+I).GT.INLEN))GOTO 10020 OUTPU0(I)=INPUT0(INLEN-(INLEN+ROTATE)+I) GOTO 10021 10020 OUTPU0(I)=INPUT0(I-(INLEN+ROTATE)) 10021 GOTO 10017 10018 OUTPU0(INLEN+1)=0 10016 CALL PUTLIN(OUTPU0,-11) CALL PUTCH(138,-11) GOTO 10006 10007 CALL SWT END C ---- Long Name Map ---- C outputline outpu0 C inputline input0 C rotatecount rotat0