All,
I intentionally didn't explain too much about the game for a couple of reasons. The first is because I haven't finalized the rules in my variation of the game. The second is because I didn't want people to focus too much on the game but rather on the guessing algorithm. Thanks to a private /msg, I realize knowing more about the game play can affect an implementation of guess().

Turns and Control

Players alternate who has control each time a new target word is presented. The player with control keeps control until they have guessed the secret word or lose control due to a violation of the rules or the total number of guesses reaches five. Both opponents have visibility to all information about the secret word regardless of who obtained the information.

Losing Control For Too Many Guesses

For each secret word, there are a total of five guesses where control can be retained. This is not per-opponent but total for the secret word. If player 1 guesses three times and loses control to player 2, player 2 only has two guesses before losing control. Once there have been five guesses for a secret word, the first unknown letter in the secret word is filled in and control passes to the opponent. If the opponent is unable to guess the word, the next unknown letter is filled in an controll passes again. This continues until all but one of the secret letters is revealed. If both players fail to guess the word at this stage - the secret word is declared a draw.

Example Scenarios

Cheers - L~R


In reply to Re: Challenge: Designing A Computer Opponent by Limbic~Region
in thread Challenge: Designing A Computer Opponent by Limbic~Region

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.