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

Thread: puzzle search

  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.

  2. #2
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    6,910

    Re: puzzle search

    ...and the c++ question is?
    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++17 Compiler: Microsoft VS2019 (16.3.9)

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)