Seek for help!! trouble with word puzzle!!

To write a complete C++ program that will find “hidden” words in a rectangle of letters. The words may appear in any direction (up, down,
forward, backward, or any diagonal) but always in a straight line

Example 1
[10 8
hbtnroch
aoehanrk
moaisgag
itivpcni
rauioibn
gterfied
lonfknri
ipumgera
ptgravyn
squasham


turkey]<this is by user input
[turkey at 4,2 SE ]<this is output

I just know how to put the first part which is entering the character but really don't know how to do the second part to read the puzzle.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# include <iostream>
using namespace std;
int main ()
	
	{
		//initialize the matrix
	char** Matrix;	//A pointer to pointers to an int.
	int x;
	int rows,columns,i, j;
	/*cout<<"Enter number of rows: ";*/
	cin>>rows;
	/*cout<<"Enter number of columns: ";*/
	cin>>columns;
	Matrix = new char*[rows];	
	

	//define the matrix
	for(i=0;i<rows;i++)
	{
		Matrix[i]=new char[columns];		//the ith array is initialized
		for( j=0;j<columns;j++)		//the i,jth element is defined
		{
			
			cin>>Matrix[i][j];
		}
	}

Topic archived. No new replies allowed.