The Random Word/Phrase Generator

Version 0.03
Matt Roberts

Sometimes when I'm trying to solve a problem, I get stuck. And, sometimes, a random word or phrase will start the free association process and get me back on track. Of course, it's still up to me to direct it rather than just go into a bout of daydreaming, but we all gotta work for a living.

The source code, heavily commented because I'm a novice at C and need all that extra information, is included for your amusement.

About Money and Other Fun Stuff

The Random Word and Phrase Generator and any files related to it are free. However, all contributions are cheerfully accepted. :)

The Warranty

There isn't any. For free you get no promises. That said, I actually use this thing, and I don't want the programs I use to be defective. So you should be fine.

The Systems

This program was written and tested on the following systems:

A Dell Latitude D620, with a dual-core Celeron Processor running at 1.3GHz per core, 4 gigabytes of RAM (the system only sees 3), and a 100 Gb hard drive. Operating system is Linux Mint 12 (Lisa), and the programming language is GCC.

Using the Program

To use the program, enter the Terminal and navigate to whatever directory you've stored the program in. You'll have to compile it. I use gcc rw.c -o rw, but you can call it whatever you want. Then type ./rw and it should generate a random word or phrase.

It expects to find a file called words.txt in the same directory, and it won't work without it. You're welcome to use the file of that name included in this mess, or you can make your own. If you do make your own, or if you change the included file, you'll need to adjust the wordcount variable to reflect the actual number of words in your new word list.

I'm trying to avoid using functions that are unique to gcc, so hopefully it'll compile on other systems with other compilers without too much fuss. No promises, though.

That should be about it. It's not a terribly complicated program, so it should be easy to adapt it to almost any language on almost any system.


0.01: The original program, written in ASIC (a shareware BASIC compiler) on an MS-DOS system
0.02: A PowerBASIC version for Windows
0.03: The current version, written for Linux Mint