Word Puzzle

There are TV-shows around, that try to get the money of the onlooker by animating them to call expensive phone numbers to solve a puzzle, that looks easy.

One of the puzzle consists of a matrix of letters, and the question is, how often can you count a word inside that matrix if you walk through the matrix.

I've watched the game show some times and I think there are a lot of cheaters who win the game. You can hear it in the sound of their voices when they tell the solution. But most of the callers are not clever enough to solve that game.

To demonstrate how the puzzle can be easily solved with an computer I've written a few lines of C-Code to count the solutions.

The letter matrix is in the word.txt file.

program call's and solution

The program "fw" counts the word "word" in the file "word.txt":

werner@work:~> cat word.txt

werner@work:~> ./fw word word.txt
solution1: start(1,1) steps:  right right right
solution2: start(1,1) steps:  right right down
solution3: start(1,1) steps:  right down  right
solution4: start(1,1) steps:  right down  down
solution5: start(1,1) steps:  down  right right
solution6: start(1,1) steps:  down  right down
solution25: start(4,4) steps:  right up    right
solution26: start(4,4) steps:  right right up
solution27: start(4,4) steps:  right right right
solution28: start(4,4) steps:  left  up    up
solution29: start(4,4) steps:  left  up    left
solution30: start(4,4) steps:  left  left  up
solution31: start(4,4) steps:  left  left  left



The license is public domain, so do whatever you want. This program comes with no warranty.

The programming language is ANSI-C.
The natural language is english.
OS independant.
Source-Code: findwords.c

back to the index page
created with quanta 3.1, werner.ho(AT)gmx.de 2003-09-20