You can grab my solution at:
http://rubyquiz.com/cowsnbulls.zip
I didn't build a player, but did provide three different interfaces.
The files in the zip are:
cowsnbulls.rb -- The library that handles the game.
Executing this gives a
command-line interface.
tc_library.rb -- Unit tests for the library.
telnet_server.rb -- Quiz solution. The protocol mentioned in
the quiz didn't
appeal to me, so I just targeted Telnet
instead. This isn't
exactly a true Telnet server, since it reads
line-by-line
(You won't see an answer to an "Are You
There" command, until
you press return, for example.), but it's
close enough
for this exercise.
web_server.rb -- Web interface through WEBrick servlets.
(Just for fun.)
english-words.10 -- The dictionary I've been using for testing.
Part of
Spell Checking Oriented Word Lists (SCOWL)
by Kevin Atkinson.
Enjoy.
James Edward Gray II