Changeable words: Difference between revisions
no edit summary
(→{{header|ALGOL 68}}: Added note) |
No edit summary |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 138:
claustrophobia <-> claustrophobic
committeeman <-> committeemen
committeewoman <-> committeewomen
complementary <-> complimentary
confirmation <-> conformation
congresswoman <-> congresswomen
craftsperson <-> draftsperson
eavesdropped <-> eavesdropper
Line 439:
committeeman committeemen
committeemen committeeman
committeewoman committeewomen
committeewomen committeewoman
complementary complimentary
complimentary complementary
confirmation conformation
conformation confirmation
congresswoman congresswomen
congresswomen congresswoman
councilwoman councilwomen
councilwomen councilwoman
craftsperson draftsperson
draftsperson craftsperson
Line 584:
5: committeeman -> committeemen
6: committeemen -> committeeman
7:
8:
9: complementary -> complimentary
10: complimentary -> complementary
11: confirmation -> conformation
12: conformation -> confirmation
13:
14:
15:
16:
17: craftsperson -> draftsperson
18: draftsperson -> craftsperson
Line 691:
5: committeeman -> committeemen
6: committeemen -> committeeman
7:
8:
9: complementary -> complimentary
10: complimentary -> complementary
11: confirmation -> conformation
12: conformation -> confirmation
13:
14:
15:
16:
17: craftsperson -> draftsperson
18: draftsperson -> craftsperson
Line 913:
claustrophobia <-> claustrophobic
committeeman <-> committeemen
committeewoman <-> committeewomen
complementary <-> complimentary
confirmation <-> conformation
congresswoman <-> congresswomen
councilwoman <-> councilwomen
craftsperson <-> draftsperson
eavesdropped <-> eavesdropper
Line 1,004:
committeeman ---> committeemen
committeemen ---> committeeman
complementary ---> complimentary
complimentary ---> complementary
confirmation ---> conformation
conformation ---> confirmation
craftsperson ---> draftsperson
draftsperson ---> craftsperson
Line 1,220:
5: committeeman -> committeemen
6: committeemen -> committeeman
7:
8:
9: complementary -> complimentary
10: complimentary -> complementary
11: confirmation -> conformation
12: conformation -> confirmation
13:
14:
15:
16:
17: craftsperson -> draftsperson
18: draftsperson -> craftsperson
Line 1,351:
5: committeeman -> committeemen
6: committeemen -> committeeman
7:
8:
9: complementary -> complimentary
10: complimentary -> complementary
11: confirmation -> conformation
12: conformation -> confirmation
13:
14:
15:
16:
17: craftsperson -> draftsperson
18: draftsperson -> craftsperson
Line 1,470:
aristotelean <=> aristotelian claustrophobia <=> claustrophobic
committeeman <=> committeemen
complementary <=> complimentary confirmation <=> conformation
craftsperson <=> draftsperson eavesdropped <=> eavesdropper
frontiersman <=> frontiersmen handicraftsman <=> handicraftsmen
Line 1,536:
Found 52 changeable words.</pre>
=={{header|Pascal}}==
==={{header|Free Pascal}}===
<syntaxhighlight lang="pascal">
{$mode ObjFPC}{$H+}
uses
Classes, SysUtils;
const
FNAME = 'unixdict.txt';
function OneCharDifference(s1, s2: string): boolean;
var
i, diffCount: integer;
begin
diffCount := 0;
if Length(s1) <> Length(s2) then
Exit(false);
for i := 1 to Length(s1) do
begin
if s1[i] <> s2[i] then
Inc(diffCount);
if diffCount > 1 then
Exit(false);
end;
Result := diffCount = 1;
end;
procedure PurgeList(var list: TStringList);
{ Remove every word that doesn't have at least 12 characters }
var
i: Integer;
begin
for i := Pred(list.Count) downto 0 do
if Length(list[i]) < 12 then
list.Delete(i);
end;
var
list: TStringList;
i, j: Integer;
begin
list := TStringList.Create;
try
list.LoadFromFile(FNAME);
PurgeList(list);
for i := 0 to list.Count - 2 do
for j := i + 1 to list.Count - 1 do
if OneCharDifference(list[i], list[j]) then
writeln(list[i]:15, ' <-> ', list[j]);
finally
list.Free;
end;
end.
</syntaxhighlight>
{{out}}
<pre>
aristotelean <-> aristotelian
claustrophobia <-> claustrophobic
committeeman <-> committeemen
committeewoman <-> committeewomen
complementary <-> complimentary
confirmation <-> conformation
congresswoman <-> congresswomen
councilwoman <-> councilwomen
craftsperson <-> draftsperson
eavesdropped <-> eavesdropper
frontiersman <-> frontiersmen
handicraftsman <-> handicraftsmen
incommutable <-> incomputable
installation <-> instillation
kaleidescope <-> kaleidoscope
neuroanatomy <-> neuroanotomy
newspaperman <-> newspapermen
nonagenarian <-> nonogenarian
onomatopoeia <-> onomatopoeic
philanthrope <-> philanthropy
prescription <-> proscription
schizophrenia <-> schizophrenic
shakespearean <-> shakespearian
spectroscope <-> spectroscopy
underclassman <-> underclassmen
upperclassman <-> upperclassmen
</pre>
=={{header|Perl}}==
<syntaxhighlight lang="perl">#!/usr/bin/perl
Line 1,559 ⟶ 1,645:
claustrophobia <-> claustrophobic
committeeman <-> committeemen
complementary <-> complimentary
confirmation <-> conformation
craftsperson <-> draftsperson
eavesdropped <-> eavesdropper
Line 1,582 ⟶ 1,668:
underclassman <-> underclassmen
upperclassman <-> upperclassmen
</pre>
<syntaxhighlight lang="perl">#!/usr/bin/perl
Line 1,715 ⟶ 1,801:
5: committeeman -> committeemen
6: committeemen -> committeeman
7:
8:
9: complementary -> complimentary
10: complimentary -> complementary
11: confirmation -> conformation
12: conformation -> confirmation
13:
14:
15:
16:
17: craftsperson -> draftsperson
18: draftsperson -> craftsperson
Line 1,817 ⟶ 1,903:
claustrophobia From claustrophobic
committeeman From committeemen
complementary From complimentary
confirmation From conformation
craftsperson From draftsperson
eavesdropped From eavesdropper
Line 1,927 ⟶ 2,013:
2: claustrophobia <-> claustrophobic
3: committeeman <-> committeemen
4:
5: complimentary <-> complementary
6: confirmation <-> conformation
7:
8:
9: draftsperson <-> craftsperson
10: eavesdropped <-> eavesdropper
Line 2,001 ⟶ 2,087:
committeeman committeemen
committeemen committeeman
complementary complimentary
complimentary complementary
confirmation conformation
conformation confirmation
craftsperson draftsperson
draftsperson craftsperson
Line 2,097 ⟶ 2,183:
5. committeeman >> committeemen
6. committeemen >> committeeman
7. committeewoman >> committeewomen
8. committeewomen >> committeewoman
9. complementary >> complimentary
10. complimentary >> complementary
11. confirmation >> conformation
12. conformation >> confirmation
13.
14.
15.
16.
17. craftsperson >> draftsperson
18. draftsperson >> craftsperson
Line 2,290 ⟶ 2,376:
5: committeeman -> committeemen
6: committeemen -> committeeman
7:
8:
9: complementary -> complimentary
10: complimentary -> complementary
11: confirmation -> conformation
12: conformation -> confirmation
13:
14:
15:
16:
17: craftsperson -> draftsperson
18: draftsperson -> craftsperson
Line 2,422 ⟶ 2,508:
5 committeeman committeemen
6 committeemen committeeman
7
8
9 complementary complimentary
10 complimentary complementary
11 confirmation conformation
12 conformation confirmation
13
14
15
16
17 craftsperson draftsperson
18 draftsperson craftsperson
|