Words containing "the" substring: Difference between revisions

add Refal
(→‎{{header|Vlang}}: Rename "Vlang" in "V (Vlang)")
(add Refal)
 
(8 intermediate revisions by 7 users not shown)
Line 341:
=={{header|Arturo}}==
 
<syntaxhighlight lang="arturo">print.lines
{{output?}}
select read.lines relative "unixdict.txt" 'l ->
and? [11 < size l]
[contains? l "the"]</syntaxhighlight>
 
{{out}}
<syntaxhighlight lang="rebol">select read.lines "unixdict.txt" 'l ->
 
and? contains? l "the"
<pre>authenticate
11 < size l</syntaxhighlight>
chemotherapy
chrysanthemum
clothesbrush
clotheshorse
eratosthenes
featherbedding
featherbrain
featherweight
gaithersburg
hydrothermal
lighthearted
mathematician
neurasthenic
nevertheless
northeastern
northernmost
otherworldly
parasympathetic
physiotherapist
physiotherapy
psychotherapeutic
psychotherapist
psychotherapy
radiotherapy
southeastern
southernmost
theoretician
weatherbeaten
weatherproof
weatherstrip
weatherstripping</pre>
 
=={{header|AutoHotkey}}==
Line 556 ⟶ 590:
weatherstrip
weatherstripping</pre>
 
==={{header|BASIC256}}===
<syntaxhighlight lang="vb">f = freefile
open f, "i:\unixdict.txt"
while not eof(f)
a$ = read (f)
if length(a$) > 11 and instr(a$, "the") then print a$
end while
close f</syntaxhighlight>
{{out}}
<pre>Same as BASIC entry.</pre>
 
==={{header|GW-BASIC}}===
{{works with|PC-BASIC|any}}
{{works with|QBasic}}
<syntaxhighlight lang="qbasic">10 OPEN "unixdict.txt" FOR INPUT AS #1
20 WHILE NOT EOF(1)
30 LINE INPUT #1, A$
40 IF LEN(A$) > 11 AND INSTR(A$,"the") THEN PRINT A$
50 WEND
60 CLOSE #1
70 END</syntaxhighlight>
{{out}}
<pre>Same as BASIC entry.</pre>
 
==={{header|QBasic}}===
{{works with|QBasic|1.1}}
<syntaxhighlight lang="qbasic">OPEN "unixdict.txt" FOR INPUT AS #1
WHILE NOT EOF(1)
LINE INPUT #1, W$
IF LEN(W$) > 11 AND INSTR(W$, "the") THEN PRINT W$
WEND
CLOSE #1
END</syntaxhighlight>
{{out}}
<pre>Same as BASIC entry.</pre>
 
=={{header|BCPL}}==
Line 1,134 ⟶ 1,204:
=={{header|FutureBasic}}==
<syntaxhighlight lang="futurebasic">include "NSLog.incl"
 
#plist NSAppTransportSecurity @{NSAllowsArbitraryLoads:YES}
 
void local fn DoIt
Line 1,983 ⟶ 2,055:
weatherstripping
</pre>
 
=={{header|Refal}}==
<syntaxhighlight lang="refal">$ENTRY Go {
, <ReadFile 1 'unixdict.txt'>: e.Dict
= <Each Show <Filter TheWord e.Dict>>;
};
 
TheWord {
(e.Word), e.Word: e.X 'the' e.Y,
<Lenw e.Word>: s.Len e.Word,
<Compare s.Len 11>: '+' = T;
(e.Word) = F;
};
 
ReadFile {
s.Chan e.Filename =
<Open 'r' s.Chan e.Filename>
<ReadFile (s.Chan)>;
 
(s.Chan), <Get s.Chan>: {
0 = <Close s.Chan>;
e.Line = (e.Line) <ReadFile (s.Chan)>;
};
};
 
Each {
s.F = ;
s.F t.I e.X = <Mu s.F t.I> <Each s.F e.X>;
};
 
Filter {
s.F = ;
s.F t.I e.X, <Mu s.F t.I>: {
T = t.I <Filter s.F e.X>;
F = <Filter s.F e.X>;
};
};
 
Show {
(e.X) = <Prout e.X>;
};</syntaxhighlight>
{{out}}
<pre>authenticate
chemotherapy
chrysanthemum
clothesbrush
clotheshorse
eratosthenes
featherbedding
featherbrain
featherweight
gaithersburg
hydrothermal
lighthearted
mathematician
neurasthenic
nevertheless
northeastern
northernmost
otherworldly
parasympathetic
physiotherapist
physiotherapy
psychotherapeutic
psychotherapist
psychotherapy
radiotherapy
southeastern
southernmost
theoretician
weatherbeaten
weatherproof
weatherstrip
weatherstripping</pre>
 
=={{header|REXX}}==
Line 2,126 ⟶ 2,272:
32. weatherstripping
done...
</pre>
 
=={{header|Ruby}}==
<syntaxhighlight lang="ruby">File.foreach("unixdict.txt"){|w| puts w if w.size > 11 && w.match?("the") }
</syntaxhighlight>
{{out}}
<pre>authenticate
chemotherapy
chrysanthemum
clothesbrush
clotheshorse
eratosthenes
featherbedding
featherbrain
featherweight
gaithersburg
hydrothermal
lighthearted
mathematician
neurasthenic
nevertheless
northeastern
northernmost
otherworldly
parasympathetic
physiotherapist
physiotherapy
psychotherapeutic
psychotherapist
psychotherapy
radiotherapy
southeastern
southernmost
theoretician
weatherbeaten
weatherproof
weatherstrip
weatherstripping
</pre>
 
Line 2,175 ⟶ 2,359:
 
32</pre>
 
=={{header|sed}}==
<syntaxhighlight lang="sed">#!/bin/sed -f
 
/^.\{12\}/!d
/the/!d</syntaxhighlight>
 
=={{header|SETL}}==
<syntaxhighlight lang="setl">program the_words;
dict := open("unixdict.txt", "r");
loop doing geta(dict, word); until eof(dict) do
word ?:= "";
if #word > 11 and "the" in word then
print(word);
end if;
end loop;
close(dict);
end program;</syntaxhighlight>
{{out}}
<pre>authenticate
chemotherapy
chrysanthemum
clothesbrush
clotheshorse
eratosthenes
featherbedding
featherbrain
featherweight
gaithersburg
hydrothermal
lighthearted
mathematician
neurasthenic
nevertheless
northeastern
northernmost
otherworldly
parasympathetic
physiotherapist
physiotherapy
psychotherapeutic
psychotherapist
psychotherapy
radiotherapy
southeastern
southernmost
theoretician
weatherbeaten
weatherproof
weatherstrip
weatherstripping</pre>
 
=={{header|Standard ML}}==
Line 2,444 ⟶ 2,679:
=={{header|Wren}}==
{{libheader|Wren-fmt}}
<syntaxhighlight lang="ecmascriptwren">import "io" for File
import "./fmt" for Fmt
 
var wordList = "unixdict.txt" // local copy
2,093

edits