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

What is a system call, What is a system call? A  system  call  is  a  r...

What is a system call? A  system  call  is  a  request  made  through  any  program  to  the  operating  system  for performing tasks, picked by a predefined set, that the said

What is the kernel, What is the kernel?          A more common definiti...

What is the kernel?          A more common definition is that the OS is the one program running at all times on the computer ,usually  known as the kernel, with all else being

What is the last entry in all bdc tables, What is the last entry in all BDC...

What is the last entry in all BDC tables? In all BDC tables the last entry is to save the data by using the field name BDC_OKCODE and a field value of '/11'.

Can we use write statements in screen fields, Can we use WRITE statements i...

Can we use WRITE statements in screen fields? If not how is data transferred from field data to screen fields? We cannot write field data to the screen using the WRITE stateme

Local minima - sigmoid units, Local minima - sigmoid units: Alternativ...

Local minima - sigmoid units: Alternatively in addition to getting over some local minima where the gradient is constant in one direction or adding momentum will increase the

C++, find the minimum total number of shelves including the loading process...

find the minimum total number of shelves including the loading process

Define both fork and vfork, How and when race conditions happen in process ...

How and when race conditions happen in process control? How can it be avoided? b. Differentiate among following functions giving related syntax: (i) fork and vfork (ii) w

Explain about RISC architecture, Q. Explain about RISC ARCHITECTURE? Le...

Q. Explain about RISC ARCHITECTURE? Let's first list some significant considerations of RISC architecture: 1. RISC functions are kept simple unless there is a very good reas

Vliw instruction word, VLIW instruction word is compacted to have floating-...

VLIW instruction word is compacted to have floating-point addition, one branch, floating point multiply, and one integer arithmetic and load/store operation as displayed in Figure

How to manage the web based projects, How to manage the web based projects?...

How to manage the web based projects? Many project management applications contain additional functions useful in the management of group projects. These features may contain g

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