Randall Bohn - 2001-08-28

gencw.py (see the cw module in CVS) is a python script that creates the C header file cw.h. The header file contains a condensed representation of the whole morse code. I didn't want to do a simple lookup table in C. That works fine for Python, Java, Perl, etc, but I figured in C it would be easier to work with byte offsets.

I had to play with the encoding (crypt) to get it in under 31 bytes (each character starts within the first 31 bytes of crypt). My simple tail contatenation function worked well enough to build the crypt, given my hand tuning efforts. The good news is that now I can re-arrange the alphabet (plain), re-run the python script and just rebuild cwtext any time I like.

I may just do that so I can print out a list of characters with their morse code equivalents. It also makes it easy if I want to change SK (end of message) from @ to some other character.

>>Avoid hand-hacking; write programs to write >>programs when you can. --Eric Raymond, TAOUP

Now I should do the same for the command line parameters...

RSBohn