From - Mon Sep 1 16:07:50 1997 Path: news.ox.ac.uk!server2.netnews.ja.net!news-peer.bt.net!btnet!news-feed1.eu.concert.net!EU.net!Norway.EU.net!sn.no!uninett.no!news.uit.no!not-for-mail From: Tom Grydeland Newsgroups: rec.games.go Subject: Re: Print-Your-Own Boards (less kilobytes) Date: 29 Aug 1997 20:08:35 +0200 Organization: University of Tromsoe, Norway Lines: 105 Message-ID: References: <3406F1F2.15FB7483@eng.ox.ac.uk.NOSPAM> NNTP-Posting-Host: mitra.phys.uit.no X-Newsreader: Gnus v5.2.25/XEmacs 19.14 Xref: news.ox.ac.uk rec.games.go:27365 Harry Fearnley writes: > Thank you all for you contributions,`. You're welcome... > All of these are _much_ better than the original as far as size goes, Hand-code PostScript usually is. People are lazier than machines. :-) > 1) A minor point they are not all the same shape : the 13x13 is more > elongated than the 9x9, and the 19x19 is even more elongated than the > 13x13. On my paper copies, the 9x9 board has an elongation of 1.08, the 13x13 board an elongation of 1.07 and the 19x19 has 1.1. To me, that's fine. I'll make the necessary modifications, though. > 2) neither the 13x13 nor the 19x19 have any indication of how much they > must be scaled to get a board of the correct size. I was more worried about getting a board that could actually come out of my printer. :-) > Can these things be fixed easily? Oh, yes. Very easily. the "scale" command in PostScript takes two arguments off the stack and treats them as the x and y scale, respectively. That means that elongation and overall size are both determined by the initial scale. So if you want a more elongated board, increase the last number before scale, if you want a bigger board of the same aspect ratio, increase *both* numbers. Similarly, the initial translate decides the x and y position of the origin (which is usually in the lower left-hand side corner of the paper.) Increasing the x value will move the grid to the right, while increasing the y value will move the grid upward. The values that are set now prints the grids fairly centered on my A4 paper, but YMMV. Hmmm. I'd forgotten how much fun PostScript is. I've modified both the 13x13 and the 19x19 boards to use thicker lines (they became thinner because of the scaling) and I've also tinkered a bit with the for loops, combining two and two of the initial loops and put the printing of the dots in nested for loops. I've also reformatted the PostScript to something I find more readable. Oh, yes, I also corrected the comments! :-) Enjoy! --- >0 --- >0 --- >0 --- >0 --- >0 --- >0 --- >0 --- >0 --- >0 --- >0 %!PS % 9x9 board with 5 dots. % author John Tromp (long story short, SvD :) % Modified to 5 dots by Tom Grydeland 62 67 scale 1 3 translate .01 setlinewidth 0 1 8 {dup 0 moveto 0 8 rlineto 0 exch moveto 8 0 rlineto} for stroke .02 setlinewidth 0 8 8 {dup 0 moveto 0 8 rlineto 0 exch moveto 8 0 rlineto} for stroke /h {.04 1 0 arc fill} def 2 4 6 {dup 2 4 6 {h} for} for 4 4 h stroke showpage --- >0 --- >0 --- >0 --- >0 --- >0 --- >0 --- >0 --- >0 --- >0 --- >0 %!PS % 13x13 board with 9 dots. % author John Tromp (long story short, SvD :) % Modified from 9x9 to 13x13 by Tom Grydeland 42.5 46 scale 1 2.3 translate .015 setlinewidth 0 1 12 {dup 0 moveto 0 12 rlineto 0 exch moveto 12 0 rlineto} for stroke .03 setlinewidth 0 12 12 {dup 0 moveto 0 12 rlineto 0 exch moveto 12 0 rlineto} for stroke /h {.06 1 0 arc fill} def 3 3 9 {dup dup 3 3 9 {h} for} for stroke showpage --- >0 --- >0 --- >0 --- >0 --- >0 --- >0 --- >0 --- >0 --- >0 --- >0 %!PS % 19x19 board with 9 dots. % author John Tromp (long story short, SvD :) % Modified from 9x9 to 19x19 by Tom Grydeland 29.5 32 scale 1.25 4.9 translate .02 setlinewidth 0 1 18 {dup 0 moveto 0 18 rlineto 0 exch moveto 18 0 rlineto} for stroke .04 setlinewidth 0 18 18 {dup 0 moveto 0 18 rlineto 0 exch moveto 18 0 rlineto} for stroke /h{.08 1 0 arc fill}def 3 6 15 {dup dup 3 6 15 {h} for} for stroke showpage --- >0 --- >0 --- >0 --- >0 --- >0 --- >0 --- >0 --- >0 --- >0 --- >0 > Harry -- //Tom Grydeland