home *** CD-ROM | disk | FTP | other *** search
- ===== listing begins here ====
-
- %**************************************
- %Crossword: Creates a crossword puzzle form or solution from the input
- %file. Squares are automatically numbered. Use a "#" for black squares
- %and a "." for blank squares.
- /BORDER
- { newpath
- COL BOXES ROW BOXES moveto
- -1 BOXES 0 BOXES rlineto
- 0 BOXES -1 BOXES rlineto
- 1 BOXES 0 BOXES rlineto
- closepath
- stroke
- } def
-
- /NUMBER
- { COL 1 sub BOXES ROW BOXES moveto
- 1 6 div BOXES 1 3 div neg BOXES rmoveto
- /Courier findfont PTSIZ scalefont setfont
- NEXTNUMBER 20 string cvs show
- /NEXTNUMBER NEXTNUMBER 1 add def
- } def
-
- /LETTER
- { /LET exch def
- COL .8 sub BOXES ROW .9 sub BOXES moveto
- /Courier findfont .8 BOXES scalefont setfont
- LET show
- } def
-
- /BLACK
- { newpath
- COL BOXES ROW BOXES moveto
- -1 BOXES 0 BOXES rlineto
- 0 BOXES -1 BOXES rlineto
- 1 BOXES 0 BOXES rlineto
- closepath
- fill
- } def
-
- /DOLINE
- { 1 1 COLS
- { /COL exch def
- BORDER
- NEWSTRING COL 1 sub 1 getinterval dup (#) eq
- { BLACK pop }
- { COL 1 eq
- { NUMBER }
- { OLDSTRING COL 1 sub 1 getinterval (#) eq
- NEWSTRING COL 2 sub 1 getinterval (#) eq or { NUMBER } if
- }
- ifelse
- dup (.) eq {pop ( )} if LETTER
- }
- ifelse
- } for
- OLDSTRING 0 NEWSTRING putinterval
- /ROW ROW 1 sub def
- } def
-
- /MAIN
- { /Courier findfont 8 scalefont setfont
- /INCH {72 mul} def
- .6 INCH 10.6 INCH translate
- /NEXTNUMBER 1 def
- /ROW 0 def
- currentfile read {pop} {quit} ifelse
- currentfile 512 string readline not {quit} if
- 0 0 moveto
- dup
- length /COLS exch def
- /NEWSTRING COLS string def
- NEWSTRING exch 0 exch putinterval
- /OLDSTRING COLS string def
- 0 1 COLS 1 sub { OLDSTRING exch (#) putinterval } for
- /BOX 7.5 INCH COLS div def
- /BOXES {BOX mul} def
- /PTSIZ 5 18 div BOXES def
- { DOLINE currentfile NEWSTRING readline not {exit} if } loop
- showpage
- } def
- MAIN
- %************************************
- %PS_DOUBLE: Two column, 80-character landscape mode
- %!PS-Adobe-1.0
- %%Creator: Carl J Lydick
- %%DocumentFonts: Courier
- %%Pages: (atend)
- /Courier findfont 6 scalefont setfont
- /N {showpage 90 rotate 0 -618 translate /H 538 def /V 71 def} def
- /O {/H 538 def /V 431 def} def
- /P {V 431 ne {O} {N} ifelse} def
- /Q { V H moveto dup length 80 gt {0 80 getinterval} if show /H H 7 sub def
- H 79 le {P} if} def
- /R 0 def
- /S 512 string def
- /T {(<FF>) search {R 0 ne {Q pop P} {pop pop /R 1 def} ifelse T} if} def
- /L {90 rotate 0 -618 translate /H 538 def /V 71 def
- {currentfile S readline not {exit} if T Q} loop showpage} def
- L<FF>
- %***********************************
- %PS_LANDSCAPE 132-character landscape
- %!PS-Adobe-1.0
- %%Creator: Carl J Lydick
- %%DocumentFonts: Courier
- %%Pages: (atend)
- /Courier findfont 9 scalefont setfont
- /P {showpage 90 rotate 0 -618 translate /H 594 def} def
- /Q {36 H moveto dup length 132 gt {0 132 getinterval} if show /H H 9.5 sub def
- H 30 le {P} if} def
- /R 0 def
- /S 512 string def
- /T {(<FF>) search {R 0 ne {Q pop P} {pop pop /R 1 def} ifelse T} if} def
- /L {90 rotate 0 -618 translate /H 594 def {currentfile S readline not {exit} if
- T Q} loop showpage} def
- L<FF>
- %*********************************
- %PS_PORTRAIT 80-character portrait
- %!PS-Adobe-1.0
- %%Creator: Carl J Lydick
- %%DocumentFonts: Courier
- %%Pages: (atend)
- /Courier findfont 11 scalefont setfont
- /P {showpage /H 750 def} def
- /Q { 36 H moveto dup length 80 gt {0 80 getinterval} if show /H H 12 sub def
- H 30 le {P} if} def
- /R 0 def
- /S 512 string def
- /T {(<FF>) search {R 0 ne {Q pop P} {pop pop /R 1 def} ifelse T} if} def
- /L {/H 750 def {currentfile S readline not {exit} if T Q} loop showpage} def
- L<FF>
- %******************************
- %PS_WIDE 132-character portrait
- %!PS-Adobe-1.0
- %%Creator: Carl J Lydick
- %%DocumentFonts: Courier
- %%Pages: (atend)
- /Courier findfont 6 scalefont setfont
- /P {showpage /H 750 def} def
- /Q { 36 H moveto dup length 132 gt {0 132 getinterval} if show /H H 7 sub def
- H 30 le {P} if} def
- /R 0 def
- /S 512 string def
- /T {(<FF>) search {R 0 ne {Q pop P} {pop pop /R 1 def} ifelse T} if} def
- /L {/H 750 def {currentfile S readline not {exit} if T Q} loop showpage} def
- L<FF>
- %*******************************************************
- %PS_NUMBERED: 80-character portrait with pages numbered
- %!PS-Adobe-1.0
- %%Creator: Carl J Lydick
- %%DocumentFonts: Courier
- %%Pages: (atend)
- /Courier findfont 11 scalefont setfont
- /NUM 1 def
- /SNUM 8 string def
- /N { 540 30 moveto NUM SNUM cvs show /NUM NUM 1 add def} def
- /P { N showpage /H 750 def} def
- /Q { 36 H moveto dup length 80 gt {0 80 getinterval} if show /H H 12 sub def
- H 54 le {P} if} def
- /R 0 def
- /S 512 string def
- /T {(<FF>) search {R 0 ne {Q pop P} {pop pop /R 1 def} ifelse T} if} def
- /L {/H 750 def {currentfile S readline not {exit} if T Q} loop N showpage} def
- L<FF>
-