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

State the scope of security policy, State the scope of security policy ...

State the scope of security policy The scope of security policy depends on aspects such as the size of the Intranet site, type of information hosted on it, and the number of u

Define syntax of barrier directive, Q. Define syntax of barrier directive? ...

Q. Define syntax of barrier directive? Barrier Directive  The syntax of barrier directive is  #pragma omp barrier When a thread attains barrier it waits till all threa

How many types of stages include in process of data mining, How many types ...

How many types of stages include in process of data mining? The process of data mining comprised three stages as given below: a) The initial exploration b) Model buildin

Explain about iframe, Q. Explain about IFRAME? is an HTML 4.0 addition...

Q. Explain about IFRAME? is an HTML 4.0 addition to frames toolbox. Presently only MSIE supports . Unlike frames created employing and

Optimum solution based on constraint problems, Optimum solution based on co...

Optimum solution based on constraint problems: Whether depending on what solver you are using so there constraints are often expressed as relationships between variables as e.

Explain the significance of encryption, Problem: (i) What are the main...

Problem: (i) What are the main threats that an organisation holding sensitive data, such as Public Data, on computer storage must guard against? (ii) To protect such data,

Use of delay loops, A very useful application of assembly is to generate de...

A very useful application of assembly is to generate delay loops. These loops are used for waiting for some time before execution of subsequent instruction. However how to find

What is the difference among choice and list, A Choice is displayed in a co...

A Choice is displayed in a compact form that needs you to pull it down to see the list of available choices and only one item may be selected from a choice. A List may be shown in

more data items and methods, Create a class called ticket that records the...

Create a class called ticket that records the information of a performance ticket.The class should include at least six data items: performanceId, seatRow, seatNo, class, price, da

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