22 lines
610 B
Text
22 lines
610 B
Text
main(params):+
|
|
seen =: new map
|
|
inwrds =: 0
|
|
pairs =: 0
|
|
palindromes =: 0
|
|
?# line =: file 'unixdict.txt' give lines
|
|
inwrds =+ 1
|
|
wrd =: string line case to lower
|
|
rwrd =: string wrd from -1 length wrd.Count step -1
|
|
? wrd = rwrd
|
|
palindromes =+ 1
|
|
?^
|
|
? seen{rwrd} = ()
|
|
seen{wrd} =: line \ not yet seen, remember
|
|
|
|
|
pairs =+ 1
|
|
? pairs < 7
|
|
print wrd __ rwrd
|
|
|
|
print pairs, "pairs, " nonl
|
|
print palindromes, "palindromes, " nonl
|
|
print inwrds, "input words."
|