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
What is SIMD? Single Instruction stream, Multiple Data stream (SIMD) shows an organization that contains many processing units under the supervision of a common control unit. A


Q. What is a DSS and Describe its components? A decision support system (DSS) is a highly flexible and interactive IT system that is designed to support decision making when t

Q. Explain about Transmission Media? These, also known as physical channels, can be either bounded or unbounded. Bounded media, in which signals representing data are confined

Draw the logic diagram of 16-bit ROM Array and explain its principle of operation. Ans: 16-bit ROM Array: A ROM that is read-only memory is an array of selectively closed

Q. How will these instructions perform? Let's assume that above machine instructions are stored in three consecutive memory locations 1, 2 and 3 and PC contains a value (1) tha

What are difference between Mealy and Moore state machine? Difference between Mealy and Moore state machine: 1) Mealy and Moore models are the fundamental models of state ma

What is a compiler? A Compiler is a program that accepts a program written in a high level language and creates an object program.

C provides a wide range of variable types. Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

Q. Describe Set-Associative Mapping? A third type of cache organization known as set-associative mapping is an improvement on direct mapping organization in that every word of