Sidney Reilley II wrote:
> #!/opt/local/bin/icon
>
> global letters
> procedure main()
> while word_length(read())
> printout()
> end
>
> procedure word_length(line)
> local length
> initial letters := list(20,0)
> if line == "." then stop("Bye")
> line ? while length := (write(*tab(many(&letters)))) do {
> tab(many(' .,;:!'))
> letters[length] +:= 1
> }
> return
> end
>
> procedure printout()
> local n
> every n:= 1 to 10 do
> write("There are ",letters[n],"",n,"letter words.")
> return
> end
Hi Sid,
A number of people have pointed out the problem, but are you also
interested in suggestions on hot make the solution stronger? The
word counting itself can be improved. To see the problem try
using the input:
Aint isn't a word.
--
Steve Wampler -- [email protected]
The gods that smiled on your birth are now laughing out loud.
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Unicon-group mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unicon-group