Thursday 26 April 2012

EVIL HANGMAN


Our assignment is to write a computer program which plays a game of Hangman using this “Evil Hangman” algorithm. In particular, our program will do following:

1. Read the file dictionary.txt, which contains the full contents of the words list.

2. Prompt the user for a word length, reprompting as necessary until he enters a number such that there's at least one word that's exactly that long. That is, if the user wants to play with words of length -42 or 137, since no English words are that long, we should reprompt him.

3. Prompt the user for a number of guesses, which must be an integer greater than zero.

4. Prompt the user for whether he wants to have a running total of the number of words remaining in the word list. This completely ruins the illusion of a fair game that we'll be cultivating.

 Evil Hangman algorithm:
1. Constructing list of all words in the English language whose length matches the input length.

2. Printing out how many guesses the user has remaining, along with any letters the player has guessed and the current blanked-out version of the word. If the user chose earlier to see the number of words remaining, print that out too.

3. Prompting the user for a single letter guess, reprompting until the user enters a letter that he hasn't guessed yet.

4. Partitioning the words in the dictionary into groups by word family.

5. Finding the most common “word family” in the remaining words, remove all words from the word list that aren't in that family, and report the position of the letters (if any) to the user. If the word family doesn't contain any copies of the letter, subtract a remaining guess from the user.

6. If the player has run out of guesses pick a word from the word list and display it as the word that the computer initially “chose.”

7. If the player correctly guesses the word, congratulate him.

6. Ask if the user wants to play again and loop accordingly.

           We use associative arrays for this purpose.

Monday 2 April 2012

MESSENGER(app) --Problem Decription

Aim: To create an application which can be used to send bulk messages to mobiles on the database.

This is to connect an entire community (class,department or entire college)according to the database option selected.
--helpful to pass information at an instant to a large number of recipients pertaining to a group.

The simple design of the app contains
* a space provided to enter the message to be passed on.
* selection of recipient group.

POSSIBLE UPGRADING:
--Two way communication (COMMUNICATOR instead of MESSENGER)
--> Requirement: A toll free number 
                          
** messages go from the communicator;
     recipient can reply to a toll free number.
     these replies should be displayed in the communicator with the recipients details.
Further development can be planned. 
                           

Labels