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 ROM? Ans: ROM: It is called Read Only Memory, is a Permanent or Semi-permanent Memory. The data is permanently stored and cannot be changed, in Permanent ROM. Th

Variables and Quantifiers: Now we have to diagnose now that if we wanted to say that there is a meal at the Red Lion which costs only 3 pounds, is well sayed. Rather thenif we

An experts systems must perform well that is achieve the same levels of performance in the domain of interest that human experts can achieve. But simply producing good so

Recombination: Therefore during the selection and mating process then the GA repeatedly lines up pairs of individuals for reproduction. Hence the next question is how to gener

Unification Algorithm - Artificial intelligence: To merge two statements, we should get a substitution which forms the two sentences similar. Remember that we write V/T to sign

Which Technologies of this age had tended to the emergence of computer network? Ans: The technologies are Communication technology and Computer technology with the support of V

The devices on the I2C bus are either masters or slaves. The master is the device that is responsible for driving the SCL clock line, while the slaves are the devices that respond


What is a Multiplexer Tree? Ans Multiplexer Tree: The largest available MUX IC is 16 to 1. Meeting the larger input requires there must be a provision to expand this. It

What is a digital comparator? Ans: Digital Comparator: The comparison of two numbers is an operation which evaluates if one number is greater than, less than, or equival