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
Give the decription of user case A use case is a description of the set of the sequence of actions which a system performs to produce an observable result which is of a value t

What guarantees the integration of all application modules? The R/3 basis system guarantees the integration of all application modules.  The R/3 basis s/w gives the run time e

Sir/Mam, I want to know the application of Theory of computation in DBMS

Define Alphabet and String? A finite set of symbols is termed as alphabet. An alphabet is frequently signified by sigma, yet can be specified any name. B = {0, 1} here B is

Make a console application to show different messages depending on the command line argument value. Use Select-case statements.(same to switch block)

find the radius of curvature at the point (3,3) at a point x3+xy2-6y2=0?

Q. Illustrate Edge-Triggered flip-flops ? Edge-triggered flip-flop is used to synchronize state change at the time of a clock pulse transition in place of constant level. A num

Briefly analyse and compare the two website designs, applying in turn each of the six design principles. This will result in six brief paragraphs. As part of each analysis, expl

Q. What is task identifier? Each and every PVM task is uniquely recognized by an integer known as task identifier (TID) assigned by local pvmd. Messages are received from and s

What is the function of in network access layer in TCP/IP protocol stack? Function of Network Access Layer: The network access layer is the lowest layer within Internet