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
Which of the fastest logic: TTL, ECL, CMOS and LSI ? Ans. The fastest logic family of all logic families ECL. High  speeds  are  possible  in  ECL  since the  transistors  a

State the structure of Verilog code you follow? A good template for your Verilog file is shown below. // timescale directive tells the simulator the base units and precision

Fetching a word from memory: CPU transfers the address of the needed information word to the memory address register (MAR). Address of the needed word is transferred to the pr

Opening Files for Reading Only     : A data file is a file that you can open and read its contents visually - for example, C source files, .dat files, HTML etc - anything that look

System Software 1. Explain MASM? Explain its features. 2. What is the significance of Lexical analysis and Syntax analysis? 3. Explain macros and macro processors? Explai

Write a menu-driven program to change a time in seconds to other units (minutes, hours, etc.).  The main script will loop to continue until the user chooses to exit.  Every time in

Q. Explain use of parallel sections construct? This illustration explains use of parallel sections construct. Three functions, fun1, fun2, and fun3, all can be executed simulta

Performance Evaluation In this part, we talk about the primary attributes used to measure the performance of a computer system. Unit 2 of block 3 is totally devoted to performa

In the past there was a large gap between speed of a memory andprocessor. So a subroutine execution for an instruction for illustration floating point addition may have to follow a

Drawbacks of linear arrays