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

Design a 4 to 1 multiplexer, Design a 4 to 1 Multiplexer by using the three...

Design a 4 to 1 Multiplexer by using the three variable function given by F(A, B, C) = ∑ m(1,3,5,6) Ans. The given function F(A,B,C) = ∑ m(1,3,5,6) can be implemented along wit

Explain that lost acknowledgement in packet retransmission, Explain that th...

Explain that the lost acknowledgement does not necessarily enforce retransmission of the packet . To guarantee reliable transfer, protocols utilize positive acknowledgement al

What is meant by "method-wars" in programming, Before 1994 there were dissi...

Before 1994 there were dissimilar methodologies like Rumbaugh, Booch, Jacobson, and Meyer etc who followed their own notations to mould the systems. The developers were in a di

Explain circular dependencies, Explain Circular Dependencies. Circul...

Explain Circular Dependencies. Circular Dependencies: To know the problem of circular dependencies consider a file server which uses a timeserver to acquire the current

Parallel computing, explain different types of parallel processing mechani...

explain different types of parallel processing mechanism

Explain recursion, What is recursion? Recursion: - Recursion is describ...

What is recursion? Recursion: - Recursion is described as a technique of defining a set or a process in terms of itself.

Why are high-speed memories required, Q. Why are high-speed memories requir...

Q. Why are high-speed memories required? Is the main memory not a high-speed memory? The answer to second question is absolutely 'No' though why so? Then if memories are slowe

What is the vertical organizational structure, What is the Vertical Organiz...

What is the Vertical Organizational Structure? This is a traditional approach that is typified by a functional approach to work in that departments work onto tasks relevant to

Determine about the virtual private networks, Virtual Private Networks (VPN...

Virtual Private Networks (VPN) In order to encrypt/decrypt all the communication network traffic that passes through the Internet or Intranet, a VPN uses software or hardware.

Determine sky wave communication is prone to fading or not, Sky wave Commun...

Sky wave Communication is prone to fading, it is true or false. Ans: It is true that sky wave Communication is prone to fading.

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