Playing with postscript

The file indicated has a few postscript procedures. You should take a copy of this and save it in your own work space. Rather than go through ftp simply view the file and save it as text. This is it.

When you have your own copy of this file you can use it in several ways. The easiest is simply to use an editor to append calls to the procedures. At the end of the text add the string "b b h b" (leave out the quote marks) save the file then use gostview to look at it. It should look like this:

You do not need to understand how it works in order to use it. The procedures are:

b
This places a brick
h
Places half a brick
q
Places a quarter brick
m
Misses half a brick
l
Starts a new line of bricks above the current row
w
Starts a new wall of bricks from the ground.
s
Places a sphere.
c
Places a column.
down
A roof brick going down.
up
A roof brick going up
x y z o
Move the origin to (x,y,z) - the default position is (-505,-700,-615)
The following "program" creates a small wall: b b b b b b h l h b b b b b b l b b b b b b b l h b b b b b b l Tack it onto the end of bricks.ps, save it then load it into ghostview.

The next stage is to get programs to write programs.

For more about the excellent PostScript language get hold of the excellent "PostScript Language Tutorial and Cookbook" by Adobe Systems Incorporated, published by Addison Wesley.