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. Define Keyword and Identifiers? Keyword:   A keyword is a statement which defines nature of that statement. If statement is a directive then keyword would be the title of t

The defining traits of an object-oriented language are: * Encapsulation * Inheritance * Polymorphism

For this assignment you should construct a comprehensive web site for Dangar Winery of Puddledock Road Armidale, makers of fine table wines and ports since 1983. Chief winemaker, A

What is state and state diagram? A state is an abstraction of values and links of an object. Set of values and links are grouped together into a state according to the group be

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

Write a program to echo the string 'Hello' to the serial channel (SCI) using the protocol of baud rate 9600,8 bits , no parity and 1 stop bit  Consider the baud register as show

Question 1 Explain the functional units of a basic computer with a neat diagram 2 What do you mean by addressing modes? List the different types of addressing modes 3 Exp

Explain the differences between Logical and physical address space Logical Vs physical address space (1) An address produced by the CPU is commonly referred to like a logica


What are the two ways of producing a list within a transaction? By submitting a separate report. By using leave to list-processing.