Semordnilap: Difference between revisions
Content added Content deleted
(→version 2: simplified code, changed wording in the REXX section header, added/changed comments and whitespace.) |
m (→version 2: bullet-proofed (as per the word length) the printing of the results.) |
||
Line 2,867: | Line 2,867: | ||
if length(u)<2 | @.u\=='' then iterate /*word can't be a unique semordnilap. */ |
if length(u)<2 | @.u\=='' then iterate /*word can't be a unique semordnilap. */ |
||
r= reverse(u) /*obtain reverse of the dictionary word*/ |
r= reverse(u) /*obtain reverse of the dictionary word*/ |
||
if @.r\=='' then do; #= # + 1 |
if @.r\=='' then do; #= # + 1 /*found a semordnilap word; bump count.*/ |
||
if #<=n then say right(@.r, 32 |
if #<=n then say right(@.r, max(32, length(_) ) )',' _ |
||
end |
end |
||
@.u= _ /*define reverse of the dictionary word*/ |
@.u= _ /*define reverse of the dictionary word*/ |