So, I need to write a program that will find all of the words in a crossword, including reversed and both horizontal or vertical. (no diagonal words). I have to store the puzzle in a two-dimensional char array, and then can only process one line at a time and one column at a time. And finally, a function that determines if the string of letters is a word or not. I have an file with over 400 words in the dictionary ( 4 letters only).
heres the code to open the file
Code:
puzzle.open("C:/Temp/word_puzzle.txt");
if (!puzzle)
{
cout << "Unable to open puzzle file" << endl;
system("pause");
return 1;
}
else
{
cout << "Puzzle file opened" << endl;
}
dictionary.open("C:/Temp/dictionary_four_letter_words.txt");
if (!dictionary)
{
cout << "Unable to open dictionary file" << endl;
system("pause");
return 1;
}
else
{
cout << "Dictionary file opened" << endl << endl;
}
Here is the word puzzle.
pxabackegs
esorelated
vmoonkcent
zrllablead
msrkradmcf
floortjukv
strxmicedc
qutamktsud
rxquitmmuy
datasetlas