Jump to content

Odd words: Difference between revisions

m
→‎version 2, caseless: added a comment.
m (→‎version 2, caseless: used more idiomatic code.)
m (→‎version 2, caseless: added a comment.)
Line 720:
minW= minL * 2 - 1 /*minimum width of a word to be usable.*/
say copies('─', 30) # "words in the dictionary file: " iFID
say
owsfinds= 0 /*count of the "odd words" found. */
do j=1 for #; L= length($.j) /*process all the words that were found*/
if L<minW then iterate /*Is word too short? Then ignore it. */
Line 729 ⟶ 730:
owU= ow; upper owU /*uppercase the odd word to be caseless*/
if @.owU=='' then iterate /*if not extant, then skip this word. */
owsfinds= owsfinds + 1 /*bump the count of "odd words" found. */
say right(left($.j, 20), 24) left(ow, 9) /*indent original word for readability.*/
end /*j*/
/*stick a fork in it, we're all done. */
say copies('─', 30) ows finds ' "odd words" found with a minimum length of ' minL</lang>
{{out|output|text=&nbsp; when using the default input:}}
<pre>
Cookies help us deliver our services. By using our services, you agree to our use of cookies.