From: Charles van den Ouweland Newsgroups: comp.lang.postscript,rec.puzzles Subject: Postcript program to print crossword puzzle Date: Fri, 06 Sep 1996 13:35:58 +0200 Organization: Alcatel Telecom Nederland Lines: 161 Distribution: world Message-ID: <32300C9E.794BDF32@ats.nld.alcatel.nl> NNTP-Posting-Host: nlsw30.ats.nld.alcatel.nl Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 2.02 (X11; I; SunOS 4.1.3_U1 sun4m) Xref: nntpd.lkg.dec.com comp.lang.postscript:44636 rec.puzzles:68306 I've just written a postscript program to print crossword puzzles: --cut here-- %!PS-Adobe 3.0 % Print a crossword puzzle diagram % features of this version: % automatic numbering % for Dutch language: lange ij (invoeren als Y) % automatic detection of height and width % letters centrered in the boxes % copyright this program 1996 C. van den Ouweland % copyright this puzzle 1996 Volkskrant/Jan Meulendijks % INSTRUCTIONS % modify contents at the very end of this file. % all lines should be equally long (max 29 characters) % use slash (/) for a black box % use space ( ) for a white box % after last line, put a line with just a single percent sign (%) % modify title of the crossword here: (Cryptogram 31 augustus 1996) /Times-Roman findfont 0.8 scalefont setfont /vakje 30 def 0.025 setlinewidth %0.3 0.4 0.1 sethsbcolor 40 700 translate vakje dup scale % modify title below: 0.1 1.5 moveto show { gsave /hoog 0 def /buf0 30 string def /buf1 30 string def /buf2 30 string def /eof false def /coubuf 3 string def /count 0 def /breed currentfile buf2 readline pop length def buf1 dup 0 1 breed {47 put dup} for pop pop { /hoog hoog 1 add def 0 %index /buf0 buf1 /buf1 buf2 dup breed 47 put def /buf2 buf0 def def currentfile buf2 readline pop (%) eq { buf2 dup 0 1 breed {47 put dup} for pop pop /eof true def } if /vorig true def buf0 { % index T exch % T index dup breed ge {exit}if dup 0 moveto % T index dup buf1 exch get % T index C dup 47 eq % T index C {C="/"?} { % T index "/" pop % T index exch pop % index 1 0 rlineto 0 1 rlineto -1 0 rlineto closepath fill %index /vorig true def } { % T index C dup 89 eq % T index C {C="Y"?} { pop (ij) } % Change it to "ij" { (?) dup 0 % T index C (?) (?) 0 4 -1 roll % T index (?) (?) 0 C put % T index (C) } ifelse gsave dup stringwidth pop 1 sub -2 div 0.3 rmoveto show grestore % T index exch % index T % bepaal of hier een verticaal woord begint % is het blokje hierboven zwart? 47 eq % index bool { % index %kijk naar het blokje hieronder dup buf2 exch get % index B % is het blokje hieronder zwart? 47 ne } { false } ifelse % index bool % als er geen verticaal woord begint, bepaal dan % of er een horizontaal woord begint { true } { %kijk naar het blokje links vorig { %kijk naar het blokje rechts dup buf1 exch 1 add get 47 ne } { false } ifelse } ifelse { gsave 0.08 0.75 rmoveto 0.4 dup scale /count count 1 add dup coubuf cvs show def grestore } if % index /vorig false def } ifelse 1 add %index } forall grestore 0 -1 translate gsave eof {exit} if } loop grestore 0 1 moveto breed hoog 1 add {dup 0 rlineto dup neg 1 rmoveto}repeat pop stroke 0 1 moveto hoog breed 1 add {dup 0 exch rlineto dup neg 1 exch rmoveto}repeat pop stroke showpage } exec /hogeschool//// /u/y//h/v/e//// mismanagement/l /s/n//r/r/f/ode /zwartleren/t/e /o/s//e/e/e/a/r e t s/ditmaal /k/i//t/e///l/i file/ o n a i n /n/k//n///a/n/g /g/m/a//b/n/d/v /sleur/papkerel /b/e/m//h/o/u/i e s e r m/koe /v/t/l//e/e/k/g /e/e/Y/kien/e/e /lariks/n//snor % --cut here-- -- __ __ Charles van den Ouweland Alcatel Telecom Nederland / V / \ mailto:ouweland@ats.nld.alcatel.nl P.O. Box 3292 2280 GG \__ D \__/ Ph +31 70 3079 126 fax 191 Rijswijk the Netherlands