Word Wrestle Game

Dennis Shasha

Omniheurist Course

Computer Science


 

Description

This is a k person game. The system specifies a random word (seed depends on the time). Each player in turn specified a word and if the prefix of that word overlaps the suffix of the compression of the previous words, then (i) that player gets the square of the number of letters in that overlap and (ii) the compression is extended by the remaining suffix of the word just placed. Every word must however extend the compression by at least one letter.

Here is an example: the system specifies "tomcat", the first player specifies "catenary". The compression of the words becomes "tomcatenary" and the first player receives 3*3 = 9 points. The next player species "rye", receives 2*2=4 points, and the compression becomes "tomcatenarye".

Architecture Team

In the two version game, the first player specifies the number of moves. You will generate a random seed depending on the millisecond at which the game starts and then will generate the first move based on a dictionary. Then play begins. You keep track of the score and end the game when the number of moves is up. You declare the winner.