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{
// 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);
// 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 the Use of functions in parallel programming? include "pvm3.h" main() {    int cc, tid, msgtag;    char buf[100];    printf("%x\n", pvm_mytid());

data floe diagrams for web conferencing

Explain the use of structures with pointers C permits a pointer to a structure variable. In fact a pointer to a structure is same to a pointer to any other variable. The pointe

Explain the PDCA cycle. PDCA is a four step problem solving method. The following are the description of each step: 1. P - Plan (Devise your Plan). Identify an opportunity a

Firewalls operate by Creening packets to/from the Network and give controllable filtering of network traffic.

Classify computer systems according to capacity. How they are different from computers according to the classification of technology. Provide comparative study also

Q. Binary floating-point number range? Smallest Negative number   Maximum mantissa and maximum exponent     =    - (1 -2 -24 ) × 2 127   Largest negative number

find a c program to find the area under the curve y=f(x) between x=a and x=b,intregrate y=f(x)between the limits of a and b.the area under a curve between two points can be found b

What is Branch prediction logic Branch prediction logic in Pentium: Pentium microprocessor uses branch prediction logic to decrease the time needed for a branch caused by in

MANAGERIAL BENEFITS Implement integrated reliability engineering and product assurance program in all aspects of the product life-cycle, covering purchase, engineering, R&D