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

Define the firewall design policy, Define the Firewall Design Policy ...

Define the Firewall Design Policy A lower-level policy that describes how the firewall will handle prevention of access and filtering of services as defined in the above net

What are the phases of swapping a page from the memory, What are the phases...

What are the phases of swapping a page from the memory? Page stealer searches the page eligible for swapping and places the page number in the list of pages to be swapped. K

What is logical address space and physical address space, What is logical a...

What is logical address space and physical address space? The set of all logical addresses generated by a program is known as a logical address space; the set of all physical a

What are the update types possible, What are the update types possible? ...

What are the update types possible? The following update types are possible: Update type A: The matchcode data is updated asynchronously to database changes. Update

How is an instruction represented, Q. How is an instruction represented? ...

Q. How is an instruction represented? Instruction is signified as a sequence of bits. A layout of an instruction is called as instruction format. Instruction formats are princi

Towers of hanoi problem, The Towers of Hanoi Problem Towers of Hanoi pro...

The Towers of Hanoi Problem Towers of Hanoi problem is described. There are three pegs on which disks are "threaded" (there are holes in the disks to allow them to be placed on

Replacement policy - cache memories , Replacement policy: On a particul...

Replacement policy: On a particular cache miss we require to evict a line to build room for the new line "In an A-way set associative cache, we have A option of which block

Explain assembly program execution, Q. Explain Assembly program execution? ...

Q. Explain Assembly program execution? An assembly program is written according to a strict set of rules. A word processor or editor is used for keying an assembly program in t

Explain about batch system, Q. Explain about Batch System? A number...

Q. Explain about Batch System? A number of computer systems only did one thing at a time. They had a list of computer system can be dedicated to a single program till its c

Explain rby and cmyk colour printing, Q. Explain RBY and CMYK colour Printi...

Q. Explain RBY and CMYK colour Printing? For good printing printers don't use RBY in place of that they use CMYK (Cyan instead of Blue, Magenta instead of Red, Yellow and a sep

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