WORD
A New Way to Make Up Words is Here
by Geoff Wells
Some of the easiest-sounding programming projects turn out to be much
more complicated than first anticipated. But, if you take on
something a little beyond your programming capabilities and succeed,
then you have stretched your knowledge and abilities.
This was the case with the program Word below. I wanted to produce a
game similar to Scrabble™ with a bag of letters of various point
values, from which I could make words. There are several books
available the give the frequency of letter use in English and these
figures are reflected in the program's data statements.
Picking random letters from this list is, of course, quite simple, but
you must then separate the letters used and put the rest back in the
bag. It is also necessary to keep track of the letters on the screen,
their positions, point values, and the names of all the players and
their scores.
All this involved several different arrays and switching information
back and forth between them.
When you type a letter it is replaced in the letter display with a
graphic block and the letter appears on the word display, along with
its point value and the total for the word. If you change your mind
about a letter, just use the backspace arrow to put it back in the
letter display and remove it from the word.
All this seemed quite a task as I had had my 80C for only a month.
However, after the program was finally running, I felt much more
satisfaction than I would have had the task been easy.
So, if you have an idea for a program but think it may be beyond you
-- go for it. You have nothing to lose but your sanity!