Jump to content

ABC words: Difference between revisions

Added XPL0 example.
m (→‎{{header|Phix}}: use GT_LF_STRIPPED)
(Added XPL0 example.)
Line 698:
54: tabernacle
55: tablecloth
</pre>
 
=={{header|XPL0}}==
<lang XPL0>string 0; \use zero-terminated strings
int I, J, K, Ch, Len;
char Word(100); \(longest word in unixdict.txt is 22 chars)
def LF=$0A, CR=$0D, EOF=$1A;
[FSet(FOpen("unixdict.txt", 0), ^I); \open dictionary and set it to device 3
OpenI(3);
repeat I:= 0;
loop [repeat Ch:= ChIn(3) until Ch # CR; \remove possible CR
if Ch=LF or Ch=EOF then quit;
Word(I):= Ch;
I:= I+1;
];
Word(I):= 0; \terminate string
Len:= I;
for I:= 0 to Len-1 do
if Word(I)=^a then
[for J:= 0 to Len-1 do
if Word(J)=^b then
[for K:= 0 to Len-1 do
if Word(K)=^c then
[if K>J & J>I then
[Text(0, Word); CrLf(0)];
K:= Len;
];
J:= Len;
];
I:= Len;
];
until Ch = EOF;
]</lang>
 
{{out}}
<pre>
aback
abacus
abc
abdicate
abduct
abeyance
abject
abreact
abscess
abscissa
abscissae
absence
abstract
abstracter
abstractor
adiabatic
aerobacter
aerobic
albacore
alberich
albrecht
algebraic
alphabetic
ambiance
ambuscade
aminobenzoic
anaerobic
arabic
athabascan
auerbach
diabetic
diabolic
drawback
fabric
fabricate
flashback
halfback
iambic
lampblack
leatherback
metabolic
nabisco
paperback
parabolic
playback
prefabricate
quarterback
razorback
roadblock
sabbatical
snapback
strabismic
syllabic
tabernacle
tablecloth
</pre>
772

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.