Monday, February 3, 2014

To make terrible wordsearches.

A long time ago I saw a "DOG" word search, in which there were a bunch of letters and only one "DOG" so I was curious how hard it would be to write a program to make terrible word searches. The answer was, very easy.

I wrote a program that creates them in C. It took about 30 minutes. It simply produces letters from a list of letters I provide it, and checks to make sure that the word in the search does not show up. If that word does show up, it starts rewriting some letters. Eventually, it creates a wordsearch without the word that you're searching for.

You then have to add the word in the search yourself.

Usage: ./wordsearch [x] [y] [word] [letter dictionary]

For example:
./wordsearch 10 10 the the
HITS: 59
h h t h h t t h t t 
h h e e t t e e e h 
h h e t t t e t h h 
h h t t t e e h e e 
e t e h h e e t e e 
h h t h t h t t t e 
e t e h e e t t e e 
h t t e t h h h t t 
e t e e t h h h h h 
t t t h h e h h t h 

Notice how the word "the" does not appear in the word search at all. You simply have to change the letters to add that word and you're set! You have made a terrible word search.

Source code:

Here are some examples:

Happy hunting.


depl0y said...

Ow man, I am going blind just by looking at them. They are indeed terrible wordsearches.

Max said...

This looked fun so I made one in Ruby. Surprisingly, it's not much slower to just keep randomly generating grids until you get one with a single occurrence of the word.

Charles said...

@Max - that is much more elegant.

Quinton Miller said...

I created one in C and PHP that puts the word in a random spot with random orientation. Then, it starts putting letters in the array, making sure that they don't create the word somehow. If this is not possible, then it just puts in one of the letters (thus making duplicates). This could be averted by restarting the process if this occurs.

Guilherme said...
This comment has been removed by the author.
Guilherme said...

fifth line from bellow to up, fifth letter begins the kayak

Paul Martin said...

Possibly dumb question, but how are you converting them to images? The program runs fine, but I feel a deep need to torture people on FB with these, and that is best accomplished with images...