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
Q. Explain Shift register with diagram and waveform.   Q. Write a short note on Decoder.

Explain Recursive Descent Parsing It is a top down parsing with no backtracking. This parsing method uses a set of recursive processes to perform parsing. Most important advant

What is reducibility?  The primary method of proving some problems are computationally unsolvable.       It is known as reducibility. Reducibility always includes two problems

What do you understand by stepwise refinement of the program? The method of "Stepwise refinement" means to take an object and move it from a general perspective to a exact leve

a. What are the activities included during the process of developing a formal specification of a sub-system interface? b. Explain the Pair Programming? What are the benefits of

As in PRAM there was not any direct communication medium between processors so a different model called as interconnection networks have been considered. In the interconnection net

Design a counter modulo 4 (sequential circuit with two flip-flops and one input U) which work like that: 1. When U=0, the state of the flip-flop does not change. 2. Whe

Address symbol table is generated by the  (A) memory management software.  (B) assembler.  (C) match logic of associative memory.   (D) generated by operating system

What is low-level formatting?  Before a disk can store data, it must be divided into sectors that the disk controller can read and write. This process is known as low-level for

127.0.0.1 is a? 127.0.0.1 it is a loop-back address.