A java applet that can be used to generate patterns and explore symmetry is available for use. In particular, "edge limit" patterns, "center limit" patterns and patterns where the foreground and background are reversible may be generated. Such patterns were made famous by the Dutch artist M. C. Escher.

A quick understanding of the program's capabilities may be obtained by working the short tutorial included in the help file.

The program consists of a Java applet (20 class files) and two supporting Perl scripts.

User Guide

A help file is included with the program. This file describes in detail the capabilities of the program and how to use it.


The java applet is called from an html file (see Patterns.html) using the following code:
<applet code="Patterns.class" width=625 height=404>
<param name=Server value="">
<param name=UserName value="bprentice">
<param name=Directory value="Patterns">
<param name=ReadFile value="pattern">
<param name=WriteFile value="pattern">
<param name=Mail value="">
<param name=Message value="A new pattern has arrived.">
The seven 'param' lines define the applet options. The value of 'Server' is the address of your server. The value of 'UserName' should be set to your user name. If you install the program in a subdirectory of your public_html directory, set the value of 'Directory' to that subdirectory otherwise set the value of 'Directory' to "".

The program saves patterns in a pattern file. This file contains a special header. For security reasons, the program will not create this file and will only append patterns to an existing file containing this special header. The file is normally called pattern and is created by making a copy of the file called header.

The values of 'ReadFile' and 'WriteFile' should normally be set to the same value pattern. If you wish to edit a pattern file, however, set the value of 'ReadFile' to an existing file and set the value of 'WriteFile' to the name of a new copy of the header file.

If you wish to be informed by mail when a new picture entry arrives set the value of 'Mail' to your email address and the value of 'Message' to the message that you want mailed. Otherwise set both of these values to "".


To implement the program do the following:
  1. Download and unzip it using WinZip. This will provide you with copies of all the files.
  2. Decide on a directory to hold your program. This will typically be your public_html directory or one of its subdirectories.
  3. Edit the Patterns.html file to reflect your needs paying particular attention to the six 'param' lines which define your options.
  4. Upload all the 'class' files, all the 'gif' files, all the 'html' files, and the header file to your selected directory.
  5. Make a copy of header and call it pattern (or the value of the WriteFile parameter if you changed this parameter).
  6. Test your program.

Server Installation

The Perl scripts ReadPicture and WritePicture and the Patterns.html file must be changed.

Line 11 of ReadPicture and line 11 of WritePicture contain the path to the server's user directory and should be changed to your user directory path. These two files should then be placed in your cgi-bin directory. The value of the Server parameter of the applet call in the file Patterns.html should be changed to your server address.


The following files are included in


You may examine and try a working example.

Source Code

The Java source code for Patterns is here, the Perl source code for the ReadPicture script is here and the Perl source code for the WritePicture script is here. The format of the picture file is described here.


  1. The Infinite World of M. C. Escher - Harry N. Abrams, Inc., New York 1984.
  2. An Implementation of the Henderson Picture Language - Lisp: A Language for Stratified Design - By Harold Abelson and Gerald Jay Sussman - Byte February 1988

Other Programs

Please take a look at my Paint Program. and the stand alone version of my Patterns Program.


This program was written by Brian Prentice who may be contacted at

If you use this program please send a postcard of your home town to the following address and if possible use an interesting stamp.

Brian Prentice,
355, So 8th St., #1
Coos Bay OR 97420