unscrambler

This is a discussion on unscrambler within the C++ Programming forums, part of the General Programming Boards category; ive been making a program that can take seven letters and put them in any order till I say stop. ...

  1. #1
    Registered User
    Join Date
    Jun 2007
    Posts
    24

    unscrambler

    ive been making a program that can take seven letters and put them in any order till I say stop. recently had a frend look at it and he said it was ok but should be able to tell if there is a word and stop when it finds one



    so basically for those whoo didn't want to read the introduction I need a way for the computer to tell if it's a word??

  2. #2
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    OK. Good project.

  3. #3
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    Well, at the very least, you'll need to:

    1. Find a dictionary file (there are plenty on the web)

    2. Read the file into a suitable format in memory (I'd recommend either a sorted std::vector<std::string>, or std::set<std::string>.

    3. For each permutation of the letters, check if that string was in the dictionary (which is where a sorted vector or a set comes in handy, it's fast).
    You ever try a pink golf ball, Wally? Why, the wind shear on a pink ball alone can take the head clean off a 90 pound midget at 300 yards.

  4. #4
    Registered User
    Join Date
    Jun 2007
    Posts
    24
    what is a dictionary file

  5. #5
    The larch
    Join Date
    May 2006
    Posts
    3,573
    A dictionary file is a file that contains all the words you want your program to "know".
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

  6. #6
    Registered User
    Join Date
    Jun 2007
    Posts
    24
    Ok Cat said it was easy to download a dictionary file but sofar I ave dwnloaded 4 things that I thought were one but werent
    Last edited by tbca; 07-28-2007 at 12:22 PM.

  7. #7
    The larch
    Join Date
    May 2006
    Posts
    3,573
    Well, you need to Google. To get you started, may-be you can copy a small word list from this (quite random) page: 850 words

    That is if you are English. I'm non-English and to this date I've found only one word-listing for my language and that is full of compound words that wouldn't make sense for a project like you have
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Word Unscrambler
    By fl00d in forum C++ Programming
    Replies: 1
    Last Post: 06-16-2008, 01:46 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21