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: http://pastebin.com/i2MBCHLQ

Here are some examples:





Happy hunting.

9 comments:

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.

https://gist.github.com/silverhammermba/8805653

Charles said...

@Max - that is much more elegant.

Unknown 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

Unknown 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...

Pepper James said...

You have created an amazing site, it is really informative. I think word search games online are also very helpful for kids, they can learn new words while having fun by playing these games.

Unknown said...

Taxis in stevensville Maryland
If you’ve crossed the Chesapeake Bay Bridge, you’ve gone right by Kent Island. Located off the west coast of Queen Anne’s County, Kent Island sits at the base of the Chesapeake Bay Bridge, connecting Maryland’s eastern and western shores. Public transportation through this area is limited, and Annapolis Taxi Cabs can alleviate difficult transportation situations. Annapolis Taxi Cabs offers reliable Taxi Cab Service in stevensvill Maryland.