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

Performance equation of computer system, Performance Equation of computer s...

Performance Equation of computer system: Following equation is frequently used for expressing a computer's performance ability: The CISC approach tries to minimize the

Example on plane, Q. If a plane is in the air also there is a fly flying in...

Q. If a plane is in the air also there is a fly flying inside the plane does the plane get heavier when the fly lands? Answer:- It is true that a fly puts weight on a plan

Declarative programming languages, Declarative programming languages: ...

Declarative programming languages: We notice that declarative programming languages can have some better compensation over procedural ones. Actually, it is often said that a J

Explain about the term business-to-customer, Explain about the term busines...

Explain about the term business-to-customer. B2C (business-to-customer): "Electronic commerce" is usually understood mostly as selling goods or services to people ("last

Parallel virtual machine, Parallel Virtual Machine (PVM): PVM (Parallel...

Parallel Virtual Machine (PVM): PVM (Parallel Virtual Machine) is portable message passing programming system which is designed to link different heterogeneous host machines to

Ai6301 - building blocks and techniques used in ai, The princess (or princ...

The princess (or prince if you're female) has been captured by the Evil Dragon and held prisoner in a tower. The tower is also surrounded by a maze to keep out the riff-raff. You

..binary tree, draw a binary tree from its inorder and preorder traversal s...

draw a binary tree from its inorder and preorder traversal sequences given as follows: inorder: d b g e h a c n f preorder: a b d e g h c f n

Translate the following sentences into predicate logic, Translate the follo...

Translate the following sentences into predicate logic. Give as much structure as possible. Provide a translation key for each predicate letter and individual constant. In your tra

Mobility management in mobile systems, Instruction 1. You can do this i...

Instruction 1. You can do this individually or in groups of 2-3 students. 2. Any material copied and pasted from anywhere (e.g., figures and text) is considered plagiarism even

Validate the xml document , As an XML expert you are needed to model a syst...

As an XML expert you are needed to model a system for an online furniture shop. After an interview with the shop manager you have the certain information: The detail of th

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