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
Describe an abstract class 'Bank' having abstract methods as 'CreateAccount' 'depositAmount' & 'withDrawAmount'.Add method definitions for 'CalculateInterest' and 'SetInterest' as

How the system would work in real time -  Sensors in/near road gather data (these can be infra-red/light sensors, pressure sensors, induction loops etc.) -data is generally num

Why cyclomatic complexity is important? Cyclomatic complexity is computed using a graph that verifies the control flow of the program. The nodes of the graph correspond to the

What are the drill-down features provided by ABAP/4 in interactive lists? ABAP/4 gives some interactive events on lists such as AT LINE-SELECTION (double click) or AT USER-COM

How  do  I  prevent  selected  parameters  of  a  module  from  being  overridden  during instantiation? If a specific parameter within a module must be prevented from being ov

The micro-instruction cycle can comprises two basic cycles: the fetch and execute. Here in the fetch cycle address of micro-instruction is produced and this micro-instruction is pu

Types of Bus: Synchronous Bus All devices gain timing information from a common clock line. Each of these intervals constitutes a bus cycle at the time duration w

Currently microcontrollers are embedded within most products, typical uses are in Camera's for auto focus and display drivers, Laser printers to compute fonts and control printing.

(a) What do you meant by an Expert System (ES) and explain briefly the essential differences between a Decision Support system and ES. (b) What are decision tables and what are