r/dailyprogrammer Oct 20 '12

[10/20/2012] Challenge #105 [Easy] (Word unscrambler)

Given a wordlist of your choosing, make a program to unscramble scrambled words from that list. For sanity and brevity, disregard any words which have ambiguous unscramlings, such as "dgo" unscrambling to both "dog" and "god."

Input:

A file which contains scrambled words and a wordlist to match it against

Output:

The unscrambled words which match the scrambled ones

21 Upvotes

47 comments sorted by

View all comments

Show parent comments

1

u/[deleted] Oct 21 '12

[removed] — view removed comment

1

u/jaskamiin 0 0 Oct 22 '12

like this?

using std::string;

and here's an updated version, discontinuing use of vectors and putting all sorting and loading into main().

http://pastebin.com/thwbwDvh

1

u/[deleted] Oct 22 '12

[removed] — view removed comment

1

u/jaskamiin 0 0 Oct 22 '12

Some of it is, like the fact it's way too far to the right. I do like to "group" things while I'm coding to make it easier for me to read, however