diff options
Diffstat (limited to 'tests/ps/toh4.ps')
-rw-r--r-- | tests/ps/toh4.ps | 302 |
1 files changed, 0 insertions, 302 deletions
diff --git a/tests/ps/toh4.ps b/tests/ps/toh4.ps deleted file mode 100644 index 7ded512..0000000 --- a/tests/ps/toh4.ps +++ /dev/null @@ -1,302 +0,0 @@ -%!PS-Adobe-1.0 -%%Creator: NIIBE Yutaka -%%Title: Towers of Hanoi (PostScript) -%%CreationDate: Wed Mar 24 15:19:30 JST 2004 -%%Pages: 61 -%%DocumentFonts: Times-Roman -%%EndComments - -% Copyright (C) 2004 NIIBE Yutaka <gniibe@fsij.org> -% -% $Id: toh4.ps,v 1.3 2004/03/24 08:17:34 gniibe Exp $ -% -% This program 'Towers of Hanoi (PostScript)' is free software; you can -% redistribute it and/or modify it under the terms of the GNU General -% Public License as published by the Free Software Foundation; either -% version 2 or (at your option) any later version. -% -% This program is distributed in the hope that it will be useful, -% but WITHOUT ANY WARRANTY; without even the implied warranty of -% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -% GNU General Public License for more details. - - -% Radius -/R 90 def -/UnitR 17 def -/ConnectionWidth 5 def - -% Number of Disks -/NumDisks 4 def -/MaxDisk NumDisks def - -% -/Direction 3 array def -Direction 0 0 put -Direction 1 1 put -Direction 2 0 put - -% -/Disk NumDisks array def -0 1 MaxDisk 1 sub { Disk exch dup 1 add put } for - -% -/Tower 3 array def -Tower 0 0 put -Tower 1 MaxDisk put -Tower 2 MaxDisk put - -/MovingDisk -1 def - -% (>) -/DrawTower { - dup - gsave - Direction exch get 0 eq {30} {-30} ifelse rotate - 0 0 R 0 360 arc - gsave - .5 setgray fill - 1.0 setgray - 0 0 R 30 180 arc fill - 0 0 R 240 390 arc fill - grestore - stroke - - Tower exch get - { - dup MaxDisk eq { pop exit } if - dup 1 add UnitR mul 0 exch 0 exch 0 360 arc - dup MovingDisk eq {fill} {stroke} ifelse - Disk exch get - } loop - grestore -} def - -/ConnectPair false def -/Hello { /ConnectPair true def } def -/GoodBye { /MovingDisk -1 def /ConnectPair false def } def - -/Turn 0 def - -/DrawConnection { - gsave - 0.1 setgray - 5 setlinewidth - 60 rotate - newpath - 0 ConnectionWidth R add 1 add moveto - 3 sqrt 2 mul R mul ConnectionWidth R add 1 add lineto - stroke - newpath - 0 ConnectionWidth R add 1 add neg moveto - 3 sqrt 2 mul R mul ConnectionWidth R add 1 add neg lineto - stroke - grestore -} def - -/DrawTowers { - 0 1.5 R mul translate - - gsave - 0.7 setgray - newpath - 0 0 moveto - 6.5 R mul 0 lineto - 6.5 R mul 6 R mul lineto - 0 6 R mul lineto closepath fill - grestore - - 1.5 R mul dup translate - - 0 DrawTower - ConnectPair Turn 0 eq and { DrawConnection } if - - gsave - 60 rotate - 3 sqrt 2 mul R mul 0 translate - 180 rotate - 1 DrawTower - ConnectPair Turn 1 eq and { DrawConnection } if - grestore - - gsave - 3 sqrt 2 mul R mul 0 translate - 120 rotate - 2 DrawTower - ConnectPair Turn 2 eq and { DrawConnection } if - grestore -} def - -[ 2 0 1 ] /Rotate201 exch def -[ 1 2 0 ] /Rotate120 exch def - -/MoveDisk { - Turn - dup Tower exch get /disk0 exch def - dup Rotate120 exch get Tower exch get /disk1 exch def - disk0 disk1 gt - { - dup Rotate120 exch get Tower exch Disk disk1 get put - Tower exch disk1 put - Disk disk1 disk0 put - /MovingDisk disk1 def - } - { - dup Tower exch Disk disk0 get put - Rotate120 exch get Tower exch disk0 put - Disk disk0 disk1 put - /MovingDisk disk0 def - } - ifelse -} def - -/ChangeDirs { - Turn - dup - Direction exch 1 put - Rotate120 exch get Direction exch 0 put - Rotate201 Turn get /Turn exch def -} def -%%EndProlog - -%%Page: 1 1 -DrawTowers showpage - -%%Page: 2 2 -Hello DrawTowers showpage -%%Page: 3 3 -MoveDisk DrawTowers showpage -%%Page: 4 4 -GoodBye DrawTowers showpage -%%Page: 5 5 -ChangeDirs DrawTowers showpage - -%%Page: 6 6 -Hello DrawTowers showpage -%%Page: 7 7 -MoveDisk DrawTowers showpage -%%Page: 8 8 -GoodBye DrawTowers showpage -%%Page: 9 9 -ChangeDirs DrawTowers showpage - -%%Page: 10 10 -Hello DrawTowers showpage -%%Page: 11 11 -MoveDisk DrawTowers showpage -%%Page: 12 12 -GoodBye DrawTowers showpage -%%Page: 13 13 -ChangeDirs DrawTowers showpage - -%%Page: 14 14 -Hello DrawTowers showpage -%%Page: 15 15 -MoveDisk DrawTowers showpage -%%Page: 16 16 -GoodBye DrawTowers showpage -%%Page: 17 17 -ChangeDirs DrawTowers showpage - -%%Page: 18 18 -Hello DrawTowers showpage -%%Page: 19 19 -MoveDisk DrawTowers showpage -%%Page: 20 20 -GoodBye DrawTowers showpage -%%Page: 21 21 -ChangeDirs DrawTowers showpage - -%%Page: 22 22 -Hello DrawTowers showpage -%%Page: 23 23 -MoveDisk DrawTowers showpage -%%Page: 24 24 -GoodBye DrawTowers showpage -%%Page: 25 25 -ChangeDirs DrawTowers showpage - -%%Page: 26 26 -Hello DrawTowers showpage -%%Page: 27 27 -MoveDisk DrawTowers showpage -%%Page: 28 28 -GoodBye DrawTowers showpage -%%Page: 29 29 -ChangeDirs DrawTowers showpage - -%%Page: 30 30 -Hello DrawTowers showpage -%%Page: 31 31 -MoveDisk DrawTowers showpage -%%Page: 32 32 -GoodBye DrawTowers showpage -%%Page: 33 33 -ChangeDirs DrawTowers showpage - -%%Page: 34 34 -Hello DrawTowers showpage -%%Page: 35 35 -MoveDisk DrawTowers showpage -%%Page: 36 36 -GoodBye DrawTowers showpage -%%Page: 37 37 -ChangeDirs DrawTowers showpage - -%%Page: 38 38 -Hello DrawTowers showpage -%%Page: 39 39 -MoveDisk DrawTowers showpage -%%Page: 40 40 -GoodBye DrawTowers showpage -%%Page: 41 41 -ChangeDirs DrawTowers showpage - -%%Page: 42 42 -Hello DrawTowers showpage -%%Page: 43 43 -MoveDisk DrawTowers showpage -%%Page: 44 44 -GoodBye DrawTowers showpage -%%Page: 45 45 -ChangeDirs DrawTowers showpage - -%%Page: 46 46 -Hello DrawTowers showpage -%%Page: 47 47 -MoveDisk DrawTowers showpage -%%Page: 48 48 -GoodBye DrawTowers showpage -%%Page: 49 49 -ChangeDirs DrawTowers showpage - -%%Page: 50 50 -Hello DrawTowers showpage -%%Page: 51 51 -MoveDisk DrawTowers showpage -%%Page: 52 52 -GoodBye DrawTowers showpage -%%Page: 53 53 -ChangeDirs DrawTowers showpage - -%%Page: 54 54 -Hello DrawTowers showpage -%%Page: 55 55 -MoveDisk DrawTowers showpage -%%Page: 56 56 -GoodBye DrawTowers showpage -%%Page: 57 57 -ChangeDirs DrawTowers showpage - -%%Page: 58 58 -Hello DrawTowers showpage -%%Page: 59 59 -MoveDisk DrawTowers showpage -%%Page: 60 60 -GoodBye DrawTowers showpage -%%Page: 61 61 -ChangeDirs DrawTowers showpage - -%%%%%%% - -%% Trailer |