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
Problem: (a) What shows a Pattern a Pattern? (b) Which pattern is given below? Justify your answer. public class A { private static A instance = null; private A() {

Explain Disadvantage of Optimal Page Replacement Algorithm Optimal page replacement algorithm cannot be implemented in the general purpose operating system as it is impossible

Explain the different page replacement policies. Various page replacement algorithms are briefly explained below: 1. First-in, first-out FIFO page replacement algorith

Pruning - artificial intelligence: Recall which pruning a search space means deciding that there certain branches to should not be explored. Moreover if an agent knows for sur

Clear operation The clear operation compares words present in A and B and produces an all 0's result if two numbers are equal. This operation is achieved by the exclusive-OR mi

The next type of input is a Pull Down List. With this type you have to employ in place of and it also has a closing tag. This control is used when we have a

What is a multitape TM?  A  multi-tape  Turing  machine  having  of  a  finite  control  with  k-tape  heads  and k-tapes each tape is infinite in both directions. On a one mov

Now let's define range which a normalised mantissa can signify. Let's presume that our present representations has normalised mantissa so left most bit can't be zero so it has to b

Question: (a) Differentiate between local variables and global variables in Lingo programming. (b) Using examples differentiate between deleteProp() and deleteAt() function

Object oriented modelling Object oriented modelling is entirely a new way of thinking about queries. This methodology is all about visualizing the things by using models organ