Keep It Simple, Stupid | |
PerlMonks |
Re: Challenge: Designing A Computer Opponentby Limbic~Region (Chancellor) |
on Dec 13, 2007 at 14:20 UTC ( [id://656823]=note: print w/replies, xml ) | Need Help?? |
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 ControlPlayers 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 GuessesFor 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 Section
Seekers of Perl Wisdom
|
|