Woburn Challenge 1998

Episode 7: Now, I am the master (mind)

INPUT FILE: prob7.in
OUTPUT FILE: prob7.out

The Rebel Alliance and the Empire have been made to realize that violence is not the answer to their conflict. They have decided to put the Tie Fighters and X-wings up on blocks and settle the war using a tried and tested method that has proven to be infallible in settling many of the universe's great conflicts. Being the wise "man" that he is, Yoda has decided to set up a meeting that brings together the warring factions from many of the great battles - Vader and Kenobi, Dr. Evil and Austin Powers and yes, even Jabba, Three Thumbs and Han Solo - to engage in a huge game of Mastermind. Of course, in his everlasting quest to improve his English, Yoda has decided not to use colours in this game of Mastermind, but instead to use 15 letter words.

Here are the rules of Mastermind:

  1. The object of the game is to guess a word randomly chosen by the computer.
  2. Each turn will begin with you guessing a word.
  3. The computer will then tell you how many letters you have in the correct place and how many you have in the wrong place (but it will not tell you which letters are correct or in the wrong place). For example: suppose you were using 8-letter words, if the correct word was "ALDERAAN", and you guessed "YODAJEDI", you would get the response: "1 letter in the correct place, 2 letters in the wrong place", ie. the "D" would be in the correct place and "A" and "E" would be in the wrong place. Note that the 2nd "D" in YODAJEDI does not count as being in the wrong place because the "D" in ALDERAAN already matches the 1st "D" in YODAJEDI. All other letters in YODAJEDI are not present in ALDERAAN.
  4. Based on this new information, you will start your next turn by making another guess, and so on, until you guess the correct word.

Of course, we're not cruel enough to expect you to program an AI engine that can create words out of nothing, so we will provide you with a dictionary of words (ie. sorted). The word that you must guess will be from one of these words. The only letters that will be used are: A, E, I, O, U, R, S, T, L, N, C, H, D. In addition, all words contain vowels.

This program will be run differently from the others in that we will add a procedure to your program so that we can score how well you do in the game. Therefore, your program must conform to some rules:

  1. You may write this program in whatever language you choose.
  2. At the end of each turn, you must call a procedure named Check with the following specifications:
    C: void Check (int* NumCorrect, int* WrongPlace, char* Guess)
    Pascal: procedure Check (var NumCorrect, WrongPlace: integer; Guess: string)
    Turing: procedure Check (var NumCorrect: int, var WrongPlace: int, Guess: string)
    Once you have made your guess, you will pass that as the string parameter Guess to the procedure Check, which will then return to you the number of letters you have in the correct place in NumCorrect and the number of letters you have in the wrong place in WrongPlace. Then you will make another guess and so on. When you have got the correct word, you will get a -1 for NumCorrect and WrongPlace. When this occurs, the program must terminate. Your program must not output ANYTHING to the screen.
  3. You have at most 1 second to guess a word during each turn.
  4. For the C people, you must include in your program.

We will score the number of guesses it took your program to guess the correct word. Your score will be compared against the other teams who submit a correct program to determine a time bonus. For a correct submission, you will still receive full marks. Note that it would be pointless if we allowed you to guess all the dictionary words and so if your program needs more than 20 guesses, it will be judged incorrect! In addition, the 3 teams with the fewest guesses will have respectively 30, 20 and 10 minutes taken away from their completion times for faring well compared to the other teams.

INPUT
A sorted list of at most 2000 8-letter words (one on each line) which will make up the list of words you have to choose from.

OUTPUT
NOTHING. Downloader failed! Response object 006~ASP 0159~Buffering Off~Buffering must be on.