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
Difference between the fork -join and begin-end. The fork - join keywords: Groups several statements together.Cause statements to be evaluated in parallel (all at the same

For this exercise you have to gather and report some linguistic data. Make sure your data are accurate by checking them with a native speaker if you yourself are not a native speak

Describe the working of components of I-way Infrastructure. Working of I-way Infrastructure components: a. Consumer access equipment shows a critical category, it is the abs

Size limitation does not relate to number of records in a table within a database. Forms, reports, macros, and modules also add to database size, but is rather minimal compared to

Explain about the term Intranet in brief. Intranet: An Intranet is a form of information system which facilitates communication into the organizations in between widely

You have a file having sporting goods that are sold online. Every item record contains the item id, item name, item description, item category, item price, and the units in stock.

What are the essential components of a 3-tier client server In a three-tier or multi-tier environment, the client executes the presentation logic (the client). The business log

a. Define parsing? Give difference among top down parsing and bottom up parsing. b. Determine the self-relocating programs? Why self-relocating programs are less efficient then

What are the mapping techniques? a)Direct mapping b) Associative mapping c)  Set associative mapping

Q. Explain Passing Parameters in General Memory? The parameters can be passed in the memory too. In such a technique name of the memory location is used as a parameter. The res