By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,188 Members | 832 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,188 IT Pros & Developers. It's quick & easy.

Needs help on making a "text twist" game within 24 hrs. *crying*

hpbutterbeer
P: 7
We have a Machine Project and my brain is currently in a clouded state. Sorry, I'm just a beginner in C Programming...

Text twist is a windows game whose main objective is to form words out of the letters shown on the screen, you move on to the next level when you are able to form a word with all the letters given. In the actual game you click on the letters of the word, in this text version you simply type the words.

To be able to facilitate the game you need to create a dictionary, this will be the basis of the words to be guessed during the game. The dictionary has the following functions:

1. Add Word. This function allows the user to add new words to the dictionary. Your program should not allow duplicates. Each word consists the following fields:
a. Word The word itself. Maximum of 7 letters.
b. Type The type of part of speech of the word (e.g. noun, adverb)
c. No of Letters The number of letters the word has not including \0. This will be useful during the game, rather than using strlen all the time.
d. No. of definitions Some words may have multiple meanings, in which case ask for he number of definitions the user wishes to enter.
e. Definitions This is an array of strings, each definition has a maximum of 50 characters and each word has a maximum of 5 definitions.
2. Delete Word. This function deletes a particular word from the dictionary.
3. Modify Word. This function modifies the fields of a word in the dictionary. The user is asked which word he/she wishes to modify, the system prompts for new values for the fields of the entry, it is similar to add except the contents are overwritten.
4. View. This function allows the user to view the contents of the dictionary. It consists of the following sub-functions.
a. View All. Views all the words and their meanings.
b. View by Type. Asks the user for a part of speech, and then displays all the words that fall under that category.
c. Search. Asks the word for an exact word, and displays all the related fields, if it does not exist it will report it to the user.
d. Search Substring. The user is asked only part of a word, a substring, and all the words that contain the substring are shown.
5. Sort. Sorts the array based on the words arranged in ascending order.
6. Save*. Saves the dictionary to a text file (dict.txt)
7. Load*. Loads a file and overwrites all he existing data in the memory with the data in the file.
8. Exit Dictionary.

GAME*

The game itself will start by selecting a word that consists of 7 letters, if there are no such words it will not continue with the game. After, the system selects words in the dictionary that can be formed from the 7 letters. These words are hidden from the user by replacing each word with an asterisk.

To enter a word the user types the word which can formed using the 7 letters, it is then printed on the screen and once the player presses enter it is checked if it in the dictionary. If it exists, then the number of letters of the formed word is added to the score and the asterisks are now replaced with the entered word. The player moves automatically to the next level if he can guess the 7 letter word correctly. To help the user he/she can press the space and the scrambled letters exchange places. There is no timer required for this game.

After each level the player is asked if he/she wants to see the definition of the words he or she was not able to guess. If the user wants to give up, he/she can press Esc, this terminates the game, if the user gets a score greater than 50 he or she is added to the list of High Scorers, there are an unlimited number of High Scorers, so use a linked list of structures.

THIS IS ONE OF THE "OUCH" PARTS: Do not use break (except within switch statements), goto label, exit, and return (except for non-void functions). Note that using gotoXY is acceptable.

please help! any tips for more added features? *needs them badly* thank you!!!
Oct 31 '06 #1
Share this Question
Share on Google+
1 Reply


hpbutterbeer
P: 7
Oh,sorry,forgot... I got a problem with randomizing the letters and how to modify,delete,definitions and add words using arrays for the dictionary.and how the scores will make an appearance whenever answered correctly.
Oct 31 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.