Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,32 @@
|
|||
string 0;
|
||||
char C, I, J, Last;
|
||||
|
||||
proc Squeeze(Char, S); \Eliminate specified repeated characters from string
|
||||
char Char, S;
|
||||
[I:= 0; J:= 0; Last:= -1;
|
||||
loop [if S(I) # Last or Char # Last then
|
||||
[C(J):= S(I);
|
||||
if S(I) = 0 then quit;
|
||||
J:= J+1;
|
||||
];
|
||||
Last:= S(I);
|
||||
I:= I+1;
|
||||
];
|
||||
];
|
||||
|
||||
int String, K, Char;
|
||||
[String:= [
|
||||
"",
|
||||
"^"If I were two-faced, would I be wearing this one?^" --- Abraham Lincoln ",
|
||||
"..1111111111111111111111111111111111111111111111111111111111111117777888",
|
||||
"I never give 'em hell, I just tell the truth, and they think it's hell. ",
|
||||
" --- Harry S Truman "];
|
||||
Char:= [0, ^-, ^1, ^l, ^ , ^-, ^r];
|
||||
C:= Reserve(79+1); \space for collapsed string
|
||||
for K:= 0 to 4+2 do
|
||||
[Squeeze(Char(K), String(if K>4 then 4 else K));
|
||||
Text(0, "<<<"); Text(0, String(if K>4 then 4 else K)); Text(0, ">>> ");
|
||||
IntOut(0, I); CrLf(0);
|
||||
Text(0, "<<<"); Text(0, C); Text(0, ">>> "); IntOut(0, J); CrLf(0);
|
||||
];
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue