Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Challenge: Designing A Computer Opponent

by Limbic~Region (Chancellor)
on Dec 13, 2007 at 14:20 UTC ( [id://656823]=note: print w/replies, xml ) Need Help??


in reply to Challenge: Designing A Computer Opponent

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

  • Player 1 has control and guesses the secret word in 3 guesses
  • Player 2 gets control for the next secret word

  • Player 1 mispells a word on the 3rd guess
  • Player 2 gets control, sees everything player 1 did, and guesses the secret word
  • Player 1 gets control for the next secret word

  • Player 1 exceeds the time limit on the second guess
  • Player 2 gets control and mispells a word on the 4th guess
  • Player 1 regains control and guesses the secret word
  • Player 2 gets control for the next secret word

Cheers - L~R

  • Comment on Re: Challenge: Designing A Computer Opponent

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://656823]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-19 05:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found