Word puzzle, Computer Engineering

You are required to make a class of WordPuzzle, which is basically a game of finding words inside a 2d-array of characters. The class needs to take rows and columns as arguments and allocate a character array of required dimensions. The character array is then to be filled with the 2d-array provided in the input file.

The class should also contain findWord function, which should take a word and check if the word appears HORIZONTALLY or VERTICALLY in the array. The starting position of the word should be returned by a call to a separate function get Position. Following is a simple class definition for you to start with.

class WordPuzzle{
public:
// constructor - also initializes array with random characters
WordPuzzle (int rows, int cols);
// find the specified word in the 2d-array
bool findWord (char *word);
// gets the position of the word last found
bool getPosition (int& row, int& col , char& dir);
private:
// whatever you need
}

Input/ Output Requirements: There is one input file for this problem, which contains dimension (row, col) in the first line. The second line contains the given 2dArray of characters. This will be followed a list of words line by line. The output file contains the word, position and direction line by line as in the input file.

Posted Date: 3/13/2013 6:56:22 AM | Location : United States







Related Discussions:- Word puzzle, Assignment Help, Ask Question on Word puzzle, Get Answer, Expert's Help, Word puzzle Discussions

Write discussion on Word puzzle
Your posts are moderated
Related Questions
The Environment variable SCRIPT_NAME in CGI script specifies? In CGI script gives the path of URL after server name.

Q. Block Format and Disk Layout on CD-ROM? A typical block format is displayed in Figure (a). It comprises the subsequent fields: Sync: Sync field identifies beginning o

Explain Sequential logic circuit Ans. Sequential logic circuit:- (i) Output not only depends upon the recent state of the input but also depend upon the earlier state

This is a huge collection of computational algorithms ranging from elementary functions like sum, sine, cosine, and difficult arithmetic, to more sophisticated functions like matri

Question: (a) A computer network can be a LAN or a WAN. Using appropriate diagrams and examples, explain what you understand by the term LAN. Your answer should also explain

Q. Program for encoding ASCII Alpha numeric? ; A program for encoding ASCII Alpha numeric. ; ALGORITHM:             ; create the code table             ; read an input

Spirit Duplicating Equipment Required Spirit Duplicator (also known as hectograph) Thermal copier (optional) Materials Masters Hectographic carbon COPY pa

What are transmission bridges? A usual transmission bridge is demonstrated in figure. The series capacitance and the shunt inductances of the two relays give a high-pass filte

We have multiple instances in RTL (Register Transfer Language), do you do anything special during synthesis stage? Whereas writing RTL(Register Transfer language),say in Verilo

Explain FDM and show how CCITT standards help in building the base band? Frequency Division Multiplexing: This is the process of combining some information channels through s