A word puzzle is a word game that consists of the letters of words placed in a grid, which usually
has a rectangular or square shape. The objective of this puzzle is to find and mark all the words
hidden inside the box. The words may be placed horizontally, vertically, or diagonally. Many word
search puzzles have a theme related to all the hidden words, such as food, animals, or colors.
|
7×7 Example board |
Example Founded Words: Meal [0,0] -> [0,3] |
Part 1 (Board Build Part): Build a 15×15 board randomly chosen from given “wordlist.txt” file. You need to take random 7 words. The words may be placed horizontally, vertically, or diagonally (8 directions). It should be changed each run. Fill the gaps with random characters.
Part 2 (Game Part):
- The player should enter the first coordinates of a word and word that the player found.
- If a word is founded in this coordinate, you need to replace the word with X and give 2 points to the user. If the word is not founded, you need to give a warning message like “Wrong choice! You have only 2 lefts.” The player can only make three mistakes.
• The player can terminate the game by writing the “:q” command, three mistakes, or finding all the words. If the game is terminated, you need to write the total points that the player got.
•
A common strategy for finding all the words is to go through the puzzle left to right (or right
to left) and look for the word’s first letter. After finding the letter, one should look at the eight
surrounding letters to see whether the following letter of the word is there. One can then
continue this method until the entire word is found.
General Rules:
Obey the style guidelines.
Do not change the provided function prototypes (you will not get any credits).
The program must be developed on Ubuntu using GCC compiler (version provided in class), compilation problems due to the use of another OS or compiler is your responsibility (you will not get any credits).
Your program should work as expected. Do not expect partial credit if your code works only in some cases but not in all cases as expected.
You can ask your questions about the homework by posting on the forum in Teams. Handing in your work:
Hand in your work using the appropriate class Teams assignment site. No
late submissions will be accepted.
Pack this directory into a zip file named 20180000001_X_Z.zip
When unpacked as above in Ubuntu (version provided in class) it should allow executing the following commands in a shell:
▪ “$make clean” removes everything except makefile, source code (.c ) and other resource files (if any) – all compiling results and intermediate files should be removed.
▪ “$make compile” should compile the code.
▪ “$make run” should run the code along with any parameters needed.




