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

Write down the basic performance equation, Write down the basic performance...

Write down the basic performance equation? T=N*S/R T=processor time N=no.of instructions S=no of steps R=clock rate

Define the terms- action semantics and argouml, Define the terms- Action Se...

Define the terms- Action Semantics and  ArgoUML Action Semantics : Action semantics is a group of firms that have responded to the OMG's RFP to define the action semantics fo

Determine the decimal equivalent of binary number, The decimal equivalent o...

The decimal equivalent of Binary number 11010 is ? Ans. 11010 = 1 X 2 4 + 1 X 2 3 + 0 X 2 2 + 1 X 2 1 = 26.

Define access time for magnetic disk, Define access time for magnetic disk....

Define access time for magnetic disk. The sum of seek time and rotational delay is known as access time for disks. Normal 0 false false false EN-IN

What is a scope resolution operator, A scope resolution operator (::), can ...

A scope resolution operator (::), can be used to describe the member functions of a class outside the class.

For what is defparam used, For what is defparam used? Though,  during  ...

For what is defparam used? Though,  during  compilation  of  Verilog  modules,  parameter  values  can  be  altered  separately  for every module instance. This allows us to pa

What is optical mark recognition, Optical mark recognition (OMR)  OMR ...

Optical mark recognition (OMR)  OMR technology scans a printed form and reads pre-defined positions (where specific fields have been filled in for instance ?-?or _); system re

C++ programming, how does a ohms law c++ programming works

how does a ohms law c++ programming works

Explain about truth table and logic diagram, Q. Explain about truth table a...

Q. Explain about truth table and logic diagram? A Boolean function can be realized in a logic circuit employing the basic gates: - AND, OR & NOT. Concern here for illustration

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