Write a program that will solve a puzzle, Computer Engineering

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).

Posted Date: 3/30/2013 1:35:34 AM | Location : United States







Related Discussions:- Write a program that will solve a puzzle, Assignment Help, Ask Question on Write a program that will solve a puzzle, Get Answer, Expert's Help, Write a program that will solve a puzzle Discussions

Write discussion on Write a program that will solve a puzzle
Your posts are moderated
Related Questions
Logical Representations: If every human being spoke the same kind of language, there would be several less misunderstanding in the world. The problem with software engineering

Q. How to Create a Layout Table in dreamweaver? In last section you used cells to create a table. Now, you will see how to start with a table and add cells later. 1.  In Obj

Q. Give the difference between Register and Counter. Q. Give the difference between Flip-flop and Latch. Q. Draw a set of waveforms for following signal on out-put line.

Applications Of Parallel Processing Parallel computing is an development of serial computing that effort to emulate what has always been the affirm of affairs in the natural wo

Addresses are basically for virtually everything we do on Internet. The IP in TCP/IP is a mechanism for providing addresses for computers on Internet. Internet addresses have two f

What is the difference between = = = and = = ? output of "==" can be 1, 0 or X. output of "===" can only be 0 or 1. When you are comparing 2 nos using "==" and if one/bo

DUPLICATING PROCESSES : As we mentioned earlier duplicating is a process whereby a master copy is prepared from which a large number of other copies are obtained with the help of

Height of a tree The length of the longest path from root to any node is called as the height of the tree.

Determine the abstraction mechanisms for modelling The object orientation conceptual structure helps in providing abstraction mechanisms for modelling, that includes: Cl

Identify the type of cohesion in the following statements: 1. Compute average daily temperatures at various sites 2. Initialize sums and open files 3. Create new temperature rec