Compsoc Progcomp

Problem 3

Deadline Passed

The Problem - Battlewords!

This is a game played between two players. Player 1 thinks of a word, Player 2 has to guess that word. Player 2 can make a guess at the word in question, and Player 1 must reply with the number of letters in common. You must write a program that plays the game from Player 2's perspective (ie you have to guess the word).

Your program will emit guesses to its standard output stream, whilst taking in the number of common letters on its standard input. If your program guesses the correct answer then it can expect a response of YES on standard input. If Player 1 is using the word 'BLACK' then the following would be an example of what your program could expect on standard in and out:

STDOUT:
GLADE
BLADE
DEAD
LACKY
BLACK

STDIN:
2
3
1
4
YES

After receiving a 'YES' your program should terminated.

Details

The dictionary is available here

Your guesses have to be valid words. When judging between correct solutions the number of guesses will be used as a metric. If two solutions both have the same number of guesses then the amount of time taken to complete the solution will be used as a metric. Bonus points can be given at the markers discretion for an interesting solution, eg a quine, or obfuscated solution. A word is considered to be valid if it is contained within the dictionary of words that we give you. The location of the file that contains the dictionary will be passed as the first parameter to your program.

Midnight of 23rd April is the deadline for this progcomp. By this we mean the midnight that bounds 24th April rather than 22nd April. All solutions should be emailed to progcomp@uwcs.co.uk with the Student number and name of the entrant. Please note that prizes have been increased for part 3 of the progcomp!