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
ASP.NET MVC uses ASP.NET routing, to map incoming browser requests to controller action process. ASP.NET Routing makes use of route table. Route table is formed when your web appli

Explain about the term RTL Fix. RTL Fix: An RTL fix implies you change the Verilog/VHDL code and you resynthesize. This generally means a new Plance and Route. RTL fixes wou

Parallel Computer Architecture Introduction We have talked about the classification of parallel computers and their interconnection networks in that order in units 2 and

Q. Define Immediate Addressing Mode with example? Immediate Addressing Mode An immediate operand can be a constant expression like a character, a number or an arithmetic e

Q. What is Arrays Pointers? An array is a collection of similar type of data. Arrays are extremely popular data structures in parallel programming because of their easiness of

Q. Explain about Decimal Numbers? Decimal number system has 10 digits signified by 0,1,2,3,4,5,6,7,8 and 9. Any decimal number can be signified as a string of these digits an

Determine the Example - "fork-join" module initial_fork_join(); reg clk,reset,enable,data; initial begin $monitor("‰g clk=‰b reset=‰b enable=‰b data=‰b", $time, cl

Compute the number of Ethernet frames formed for a data of 64 KB IP packet. Following figure demonstrates the format of the Ethernet frame. Here maximum data into a frame is 15

Q. Illustrate TCP - IP Networking Model? TCP/IP is an acronym for Transmission Control Protocol / Internet Protocol. It is a collection of applications, protocols and services.

Q. Illustrate what is a ion pair energy? Answer:- Ion energy contains electric charges called protons (+) and neutrons (0) and electrons (-) charges. It's present in an at