dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: puzzle search

Threaded View

  1. #1
    Join Date
    Oct 2016
    Posts
    39

    puzzle search

    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
    Last edited by jessicacates; November 26th, 2016 at 02:26 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)