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
Q. Initialize new PVM processes? pvm_spawn( char *task, char **argv, int flag, char *where, int ntask, int *tids ) Initialize new PVM processes. Task a character st

Which type of web document is run at the client site? Active web document is a type of web document is run at client side.

What is reification? It is the promotion of something that is not an object into an object. Helpful method for Meta applications. It shifts the level of abstraction. Promote

Grid Computing means applying the resources of a lot of computers in a network simultaneously to a one problem for solving a scientific or a technical problem that needs a large nu

What is the fundamental Digital Design? Digital design is distinct through analog design. In analog circuits we deal along with physical signals that are continuous in amplitud

Q. What is Rambus DRAM? RDRAM which was developed by Rambus has been adopted by Intel for its Pentium and Itanium processors. It has become main competitor to SDRAM. RDRAM chip

Q. Explain about Registers? A register is a group of flip-flops that store binary information and gates that controls when and how information is transferred to register. An n-

Restating the Requirements To have clarity of analytical model of system you must state requirements specific performance constraints with optimization criteria in one documen

Non-Uniform Memory Access Model (NUMA) In shared memory multiprocessor systems, local memories are able to be connected with every processor. The collection of all local

Write the Add/subtract rule for floating point numbers. Ans: a. Select the number with the smaller exponent and shift its mantissa right a number of steps equal to the differe