Write a program that will solve a puzzle, Computer Engineering

Assignment Help:

You will write a program that will solve a version of the common newspaper puzzle \word search." In the puzzle you are given a grid lled with characters and a list of words to nd and circle in the grid. Words may go left-to-right, top-to-bottom or diagonally (upper-left to lower-right).

Your program will solve this problem with a twist: the words can \wrap around." Consider the example below.

e b h a t
d e t n t
a t n o h
t u e t t

The example has several \wraparound" words. the word \hat" starts at position (0,2) (in row, column format) and is horizontal. The word \tube" starts at position (2,1) and is vertical. The word \tote" starts at position (1,2) and is diagonal.

When determining the next diagonal position, you can think of it as a two step process: compute the next column (as you would for a horizontal sequence); compute the next row (as you would for a vertical sequence). Note that the next diagonal position after the lower right position is always (0,0).

Wraparound words can even overlap themselves! For example, the word \dated" appears vertically beginning at position (1,0). They can even wraparound multiple times! Your program will read a le containing the grid and the list of words to search for and you will output for each word all occurrences of it in the grid. Your output should, for each word, list all occurrences in the format we've used above (i.e., beginning coordinate and \type" { horizontal, vertical or diagonal).


Related Discussions:- Write a program that will solve a puzzle

The major underlying concepts of object orientation, Objects, messages, cla...

Objects, messages, class, inheritance and polymorphism are the major concepts of object orientation.

Path & Path Production, Take the following flow graph and use the procedure...

Take the following flow graph and use the procedure in chapter 8 to derive an equivalent regular expression. Show all intermediate graphs (to ensure that you follow the procedure,

Find simplified function f and implement, Q. Find simplified function F and...

Q. Find simplified function F and implement that function using only NAND gates. 1. F(A,B,C) = (A+B) (A'+B+C') (A'+B'+C') 2. F (A,B,C) = A'B'C'+B'CD'+A'BCD'+AB'C' 3. F(X,Y

Simulated annealing - artificial intelligence, Simulated Annealing: On...

Simulated Annealing: One way to get around the problem of local maxima, and related problems like ridges and plateaux in hill climbing is to allow the agent to go downhill to

Determine about the memory stack, Memory Stack Stack could exist as a s...

Memory Stack Stack could exist as a stand-alone unit or could be executed in a random-access memory attached to the CPU. The implementation of a stack in a CPU is done by assig

What do you understand by scan codes, Q. What do you understand by Scan Cod...

Q. What do you understand by Scan Codes? A scan code is a code produced by a microprocessor in keyboard when a key is pressed and is unique to key struck. When this code is rec

Define the vbscript basics, VBScript is an easy and powerful to learn tool ...

VBScript is an easy and powerful to learn tool which can be used to add interaction to your Web pages. Web browser receives scripts along with rest of the Web document. Browser par

Explain about olap, OLAP is called as online analytical processing which gi...

OLAP is called as online analytical processing which gives answers to queries which are multi dimensional in nature. It composes relational reporting and data mining for giving sol

State the Process of sending signals to televisions, Determine about the Si...

Determine about the Signals to televisions Signals to televisions are now sent digitally thus need a computer to interpret as well as decode these signals into a sound/picture;

Operating system, explain network operating system and design issues?

explain network operating system and design issues?

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