Word puzzle, Computer Engineering

Assignment Help:

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.


Related Discussions:- Word puzzle

Masters and slaves, The devices on the I2C bus are either masters or slaves...

The devices on the I2C bus are either masters or slaves. The master is the device that is responsible for driving the SCL clock line, while the slaves are the devices that respond

Determine by which digits are represented in dtmf phone, In a DTMF phone, d...

In a DTMF phone, digits are represented by: (A)  Orthogonal frequencies. (B)  Orthogonal Phases. (C)  Orthogonal codes. (D)  Orthogonal pulses. Ans: Di

Which things should microprocessor validate, Q. Which things should micropr...

Q. Which things should microprocessor validate? A microprocessor should validate: Powerful addressing modes More addressing capability More throughput Po

Example on hamming error correcting code, Q. Example on hamming error corre...

Q. Example on hamming error correcting code? For illustration a 4-bit matching word can stand for 2 4 =16 values that range from 0 to 15 as: 0000, 0001, 0010, 0011, 0100, 01

Show the comparison of ascii and ebcdic, Q. Show the Comparison of ASCII an...

Q. Show the Comparison of ASCII and EBCDIC? EBCDIC is an easier to employ code on punched cards due to BCD compatibility. But ASCII has some of major benefits on EBCDIC. These

What is scan, What is "Scan"? Scan Insertion and ATPG helps test ASICs ...

What is "Scan"? Scan Insertion and ATPG helps test ASICs (e.g. chips) during manufacture. If you know what JTAG boundary scan is, then Scan is the similar idea except that it i

What is usb, What is USB USB (UNIVERSAL SERIAL BUS) is intended to conn...

What is USB USB (UNIVERSAL SERIAL BUS) is intended to connect peripheral devices like mouse, keyboards, modems and sound cards to microprocessor through a serial data path and

Convert the following into pos form, Q. Convert the following into POS form...

Q. Convert the following into POS form 1.  (AB + C + DC)(AB + BC + D) 2.  WYZ + XYZ + W'X'Y + W'XYZ 3.  XY + XZ + X'YZ' 4.   (A+B'+C) (AB+AC') 5.   F(A,B,C,D)=M(0,3,

Explain biometric systems, Explain Biometric Systems Biometrics is the ...

Explain Biometric Systems Biometrics is the science of measuring physical properties of living beings. Biometric Authentication (1) Biometric authentication is the aut

Is dos a real time os, DOS is not a RTOS (real time Operating system), thou...

DOS is not a RTOS (real time Operating system), though MS DOS can be used with certain APIs to attain the RTOS functionality. For example, the RT Kernel (Real Time Kernel) which ca

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd