Description
The Word Hunter Game
The word hunter game typically consists of scrambled letters in a grid in
which player seeks for hidden meaningful words. Hidden words are placed
vertically, horizontally or diagonally. They may overlap but cannot be in
zigzag form or wrap around. Your task is to create a word hunter puzzle and
let the player play the game.
This is a 6×6 puzzle. There are 4
words hidden in this puzzle. That
are:
• “hello” [4,0] & [4,4]
• “world” [1,0] & [5,4]
• “great” [0,0] & [0,4]
• “random” [5,5] & [0,5]
Puzzle Map: Puzzle map is a 15×15 grid where each cell contains a character.
To build a puzzle map, you must do the followings:
1. Fill the whole map with randomly assigned characters. To do so, use a
function that simply returns a random character without taking any
input.
2. Words and their locations are stored in a file called
“word_hunter.dat”. The given piece of code reads the file and stores
the words in a pointer array called “dict”. Coordinates of each word
is also stored in an array called “coordinates”. Size of coordinates
is 15×4 which are starting [x1, y1] and ending positions [x2, y2] of a
word. You must place the words in dictionary on puzzle based on
coordinates.
Gameplay: At the beginning of the game, puzzle is printed on the screen. All
characters are lowercase. Then, program asks for a word and a coordinate
(r=row, c=column). The coordinate can be either the beginning or the end of
a word. Thus, program must search for all 8 directions (e.g., north, northeast, east, south-east etc.) as soon as player enters a guess (word). If
guess of player is true, corresponding word on map must be converted to
uppercase. Otherwise, there is no change on the map.
Termination Conditions:
1. Player finds all the words in the puzzle.
2. Player types “exit game”.
CSE102 – Computer Programming Homework #5
Page 2 of 2
Cumulative Grading Points:
1. [10pts] Filling the whole map with only random characters and printing
on the screen.
2. [25pts] Placing the words on map based on given coordinates and
printing on the screen.
3. [30pts] Exiting game when user types “exit game”.
4. [90pts] Searching for 8 directions. Each direction is 7,5pts.
5. [95pts] Making the word uppercase, if user finds the word.
6. [100pts] Finishing the game when all words are found.
If you only do choice 1, you get 10pts. If you do choice 1 & 2, you get 25.
You cannot do choice 2 by itself. And so on…
General Rules:
1. Obey and don’t broke the function prototypes that are shown on each
part, if any, otherwise, you will get zero from the related part.
2. You are not allowed to use string.h library. However, you can write
your own string functions. You can also use the functions that I
wrote.
3. Note that if any part of your program is not working as expected, then
you can get zero from the related part, even it’s working in some way.
4. Upload your .c file on to Moodle to deliver your homework.
5. You can ask any question about the homework via Moodle Forum.
Corresponding TA: M. Rasih ÇELENLİOĞLU (mcelenlioglu@gtu.edu.tr)