This is similar to other hang-man style problems already posted, except, in this case, the computer is the one guessing. Computers are logical, smart, and consider self-preservation to be important, so there are a few RULES for how computers will guess.
The user will think of any word, that will be contained in the FULL Ispell word list. some of these may be upwards of 10-15 letters. The wordlist is simply the full ispell wordlist (english, and others, all combined), and may be placed in a folder with the program.
The computer will be given 8 lives. The computer will start by simply asking for an input of however many characters the word is. (example game below). After that, the computer will begin guessing, following the ruleset below!
- the computer will analyze all possible word outputs, and determine what letter guess has the most possible correct answers, and guess that letter. It will not duplicate any prior guesses.
- the computer will then ask for an updated word input, determine if it was correct at all, or wrong, and if wrong, will deduct 1 life.
Lastly, the computer will state the lives remaining.
EXAMPLE GAME User picks the word "Engineer" Computer asks for Letter count, User replies 8. Computer searches for most likely letter to be used in 8 letter words, determines it is letter H (not correct). Guesses H. User replies _ _ _ _ _ _ _ _ Computer outputs "7 lives remaining" and then picks the next most likely letter, an E User replies e _ _ _ _ e e _ computer outputs "7 lives remaining" and then recalculates based on its current knowledge what is the most likely next letter. Game continues until computer will state WIN, or LOSE.
SCORING: every program should follow the EXACT same method to arrive at the final answer. If yours follows the order of every other program, you receive -100 points. If yours is different (aka wrong), you receive 1000 points.
each byte of code is worth 1 point. a 30 letter code, is 30 points.
if your code manages to play each step of the game in less than 5 seconds, award yourself -100 points.
The winner will be chosen 1 week from the first answer, and a new question related to this one, will be asked. Obviously those with the best code here will have a head start on the new one!
EDIT: forgot to make note that as in golf, the lowest score wins.