Program
In
early 1993, I finally become convinced that Windows was going to be the
dominant operating system on small computers for some time to come. Not
wanting to be left behind, I decided to learn how to write programs for
Windows 3.1. For many years I had been programming for the DOS operating
system, using a programming language from Microsoft called BASIC 7 PDS.
Many professional programmers consider C to be the best programming
language, but I prefer BASIC because it allows me to write programs much
more quickly than I could in C. In March of '93, I flew out to San Mateo
to take a week long course in a new programming language for Windows
called Visual BASIC 3.0, or VB3 for short.
When I got back from California, I installed VB3 on my 66 Mhz Gateway
2000, and spent a week poking around in the language, assessing its
strengths and weaknesses. Next I started writing some baby applications.
My son Pete drew a large background, and also a picture of one of his
invented heros named Electro Boy. I scanned this art into my computer
and wrote a program called ELECTROBOY which moved the figure about on
the background. Next I wrote three VB3 programs that created
mathematical curves. HYPO was the first, and it drew trochoids ---- the
same kind of curves produced by the popular children's toy made by
Kenner called a Spirograph. Next was my SPIRO program, which made
star-like spirolaterals, and, finally, I wrote TESS, which drew
mathematical tiling patterns. With all this practice, I gradually became
comfortable working in the Windows environment, and one night I decided
that it was time to try something more ambitious ---- it was finally
time to begin writing SymmeToy!
I began by writing a simple vector-based drawing and painting program.
When I was done, I had a program that could draw straight and curved
lines and also arcs and circles. Because it was vector-based, the
program built a stack of numbers which could be used to store or
regenerate a drawing at a later time. Numbers which indicated where each
painting color was to start were also kept in this stack of numbers.
From these starting points, colors would flood out in all directions
until stopped by the drawn lines of the picture. This "flood-filling"
technique was very fast in operation and only required that three
numbers be stored on the stack for each area to be painted. So at this
point, I had a program that created a stack of numbers that told exactly
how to draw and color a picture on the computer's screen. The next step
was to write code that could duplicate such pictures symmetrically.
Any of the possible symmetric patterns can be created by using just
three kinds of mathematical operations ---- translation, rotation and
reflection. With translation, a copy of the basic drawing is shifted to
another point on the screen, with rotation the copy of the drawing is
rotated, and with reflection the copy is reflected to give a mirror
image. These operations are very easy to do on a stack of numbers in a
computer; the hard part was to develop a grid system that would record
instructions on just which operations were to be performed for a
specific part of a particular picture. It was a thrilling night indeed
when the grid system started working, and a symmetric picture appeared
on the screen of my computer for the first time.
The drawing program and the grid system are at the heart of SymmeToy,
and the rest of the program just consists of useful and needed additions
to these core components. For many months I added code and experimented,
and then added more code and experimented further. By December of 1993
the program was nearing completion, and it was time to write some
instructions on how to use it. The writing of the book on SymmeToy has
turned out to be as interesting, and as time consuming, as the writing
of the program itself. Once the book and the program are complete it
will be time for my beta testers to go to work, pointing out my writing
errors and finding the bugs in SymmeToy. |
 
 |