[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Jotto puzzle: first five guesses



On 22 Jul 99, at 11:35, Matthew Wickline wrote:

> a month or so ago, someone showed me how to play jotto. It's
> sort of a word-game version of Mastermind (for those of you
> familiar with Mastermind).

[ ... ]

> What's that got to do with perl?
> 
> Well, in thinking about the game, there are all sorts of
> neat things you can do to explore it with perl.
> 
> If you play a bit of jotto, you may see that one decent
> initial strategy is to guess a series of words which don't
> share any words in common.

As a secondary programming problem-add on, let me mention that as a long-
time jotto player I coded up a player years ago that was pretty much 
unbeatable, but astoundingly simple:

In each turn, the computer simply picks a word *AT*RANDOM* [!] that is 
still possible [that is, that is still consistent with all of the 
previous info].  First word is just picked entirely at random, and you go 
from there.  Trust me: you *cannot* beat this program, even with this 
simple a strategy [although not so trivial to implement: hence the 
programming problem]

[NB: I hit on this strategy while i was trying to whip up an 'optimal' 
player: I did lots of hacking [and wasted HUGE amounts of computer time] 
working on building a "decision tree" with minimim depth, and it all 
proved to be pretty hard and a mess... then I decided to try the strategy 
of simply "always pick a word that could _possibly_ be the secret word" 
and it proved to be VERY effective.

[although if you're familiar with jotto you'll find it to be _very_ 
unsatisfying to play against the computer:
  1) the computer will always win [at least it always beat me!]
  2) it is no fun --- the computer doesn't "sneak up" on the solution or
     try patterns of words or anything like that, so you can't tell at
     all how close or not close the computer is... it just asks words
     that _seem_ to be random, and then guesses yours, out of the blue.
     It really is irritating! :o)

  /Bernie\
-- 
Bernie Cosell                     Fantasy Farm Fibers
mailto:bernie@fantasyfarm.com     Pearisburg, VA
    -->  Too many people, too few sheep  <--          

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe