Documentation for WALLPAP3.PAS November 19, 1986 by Carson Wilson Lillipute Z-Nodes, Chicago 312-649-1730 312-664-1730 "Wallpaper for the Mind," A. K. Dewdney's column in the September, 1986 issue of _Scientific American_, contains three programs which create interesting patterns which are "almost, but not quite, repetitive" (Dewdney, 1986, p. 14). These programs use recursion to produce "richly embroidered patterns [which] do not repeat themselves, at least not exactly; instead each pattern continually manifests itself in new contexts and configurations, left and right, up and down" (ibid). WALLPAP3 is a Turbo Pascal program derived from the first program mentioned in Dewdney's column, written by John E. Connett of the University of Minnesota. Connett's program was inspired by the Mandelbrot Set, which uses similar principles to generate interesting patterns. (For more on the Mandelbrot Set, see "Computer Recreations" in the August, 1985 issue of _Scientific American_, or download MBROT5.LBR or MBROTCOM.LBR which contain, respectively, Turbo Pascal source for a Mandelbrot generator and a compiled, executable Mandelbrot generator for CP/M computers.) -*-*-*- In WALLPAP3.LBR, you should find five files: 1) WALLPAP3.PZS - Crunched Turbo Pascal Source Code. 2) WALLPAP.DZC - This file. 3) WALLPAP3.CZM - Crunched, executable CP/M program. 4) WHATSFOR.NOT - Short message describing the library. 5) WALLPAP3.NEW - Changes from version 2 The files with Z's in their names have been compressed to save space using CRUNCH.COM, version 2.1. They need to be "uncrunched" using UNCR.COM version 2 or greater before use. Before using WALLPAP.COM, make sure it is installed for your computer printer. Try running the program. When prompted with the question: "The currently installed printer is -UnInstalled- Do you wish to change it (Y/N)? ", respond by striking "Y". You will see a menu of printer types, followed by the option to "Install for other printer." If your printer type is listed in the menu, choose it. Otherwise, choose the option to exit the program. You will need to make some calculations before running WALLPAP. THE CALCULATIONS: The output of WALLPAP is a square matrix of periods, which are sent to your default printer. For the best image quality, these periods should be the same distance apart vertically as they are horizontally, and they should be as close together as possible without actually touching. Because of the limited capabilities of some printers, this optimal setting may not be possible, but it should be approximated as closely as possible. To calculate the best setting for your printer, you will need to consult your printer's manual. First find out what the smallest character pitch available is. For example, the Okidata 182 can print text at up to 17.1 characters per inch. If your printer can generate text at such a fine pitch that consecutive periods (".") overlap one another, then you will have to experimentally determine what the best pitch for you is. Write down the control code(s) which will tell the printer to begin printing in the desired pitch. Once you have determined the optimal characters per inch setting, work on the number of lines per inch. This should be as close to the number of characters per inch as possible. Write down the codes for the proper lines per inch command also. After determining the proper printer setup codes, you should find out how to set your printer back to normal (probably 10 characters per inch and 6 lines per inch). Most printers will do this when they receive a simple control code from your computer. Find the control code to do this, and write it down. If you cannot find such a code, don't worry - turning your printer off and back on will do the same thing. One final value needs to be calculated before installation. WALLPAP.COM needs to know how many characters will fit on a single line of printer output. To find this value, multiply the width of your printer's output (normally 8 inches) by the number of characters per inch you have decided on. For example, the Okidata 182 will print at a pitch of 17.1 characters per inch, so the number of characters which will fit on a single line is (17.1 * 8 = 136.8). If the result is fractional, leave off the fractional part. (In my example, 136.8 is truncated to 136). Now run WALLPAP, and when the program asks you if you want to change the currently installed printer, answer "yes." When the menu of printer selections comes up, select the option to "Install for other printer." Enter the control codes as you are prompted for them. Try running the rest of the program and see if the output is to your liking. If so, you may make the settings permanent by quitting WALLPAP and using CP/M's SAVE command to create the new version. That's all there is to it! Bibliography Dewdney, A. K. "Wallpaper for the Mind." _Scientific American_, vol. 255, #3 (September, 1986). pp. 14-23.