41 lines
945 B
Text
41 lines
945 B
Text
string 0;
|
|
def LF=$0A, CR=$0D;
|
|
|
|
proc Reverse(Str, Len); \Reverse order of chars in string
|
|
char Str; int Len;
|
|
int I, J, T;
|
|
[I:= 0;
|
|
J:= Len-1;
|
|
while I < J do
|
|
[T:= Str(I); Str(I):= Str(J); Str(J):= T;
|
|
I:= I+1; J:= J-1;
|
|
];
|
|
];
|
|
|
|
char Str;
|
|
int I, LineBase, WordBase;
|
|
[Str:=
|
|
"---------- Ice and Fire ------------
|
|
|
|
fire, in end will world the say Some
|
|
ice. in say Some
|
|
desire of tasted I've what From
|
|
fire. favor who those with hold I
|
|
|
|
... elided paragraph last ...
|
|
|
|
Frost Robert -----------------------";
|
|
I:= 0;
|
|
repeat LineBase:= I;
|
|
loop [WordBase:= I;
|
|
repeat I:= I+1 until Str(I) <= $20;
|
|
Reverse(@Str(WordBase), I-WordBase);
|
|
if Str(I)=CR or Str(I)=LF or Str(I)=0 then quit;
|
|
I:= I+1; \skip space
|
|
];
|
|
Reverse(@Str(LineBase), I-LineBase);
|
|
while Str(I)=CR or Str(I)=LF do I:= I+1;
|
|
until Str(I) = 0;
|
|
Text(0, Str);
|
|
CrLf(0);
|
|
]
|