gdritter repos board-games / master shogi.ps
master

Tree @master (Download .tar.gz)

shogi.ps @masterraw · history · blame

%!PS

72 72 scale
0 setgray
0.01 setlinewidth

/mkpiece {
  dup
  exec fill piece stroke
  1.2 0 translate
  piece stroke
  1.2 0 translate
  exec promoted fill piece stroke
  1.2 0 translate
} def

/mksingpiece {
    exec fill piece stroke 1.2 0 translate
    piece stroke 1.2 0 translate
    piece stroke 1.2 0 translate
} def

/piece {
  0 0 moveto
  1 0 lineto
  1 1 lineto
  0.5 1.25 lineto
  0 1 lineto
  closepath
} def

/promoted {
  0.2 1 moveto
  0.8 1 lineto
  0.5 1.15 lineto
  closepath
} def

/lance {
  0.4 0.15 moveto
  0.6 0.15 lineto
  0.5 0.8 lineto
  closepath
} def

/pawn {
  0.3 0.15 moveto
  0.7 0.15 lineto
  0.5 0.7 lineto
  closepath
  0.6 0.75 moveto
  0.5 0.75 0.1 0 360 arc
  closepath
} def

/knight {
  0.3 0.15 moveto
  0.7 0.15 lineto
  0.6 0.8 lineto
  0.4 0.8 lineto
  closepath
  0.6 0.5 moveto
  0.8 0.5 lineto
  0.8 0.6 lineto
  0.6 0.8 lineto
} def

/bishop {
  0.75 0.4 moveto
  0.5 0.4 0.25 0 360 arc
  closepath
  0.6 0.75 moveto
  0.5 0.75 0.1 0 360 arc
  closepath
} def

/rook {
  0.3 0.15 moveto
  0.7 0.15 lineto
  0.7 0.85 lineto
  0.3 0.85 lineto
  closepath
} def

/s_general {
  0.5 0.15 moveto
  0.8 0.5 lineto
  0.5 0.85 lineto
  0.2 0.5 lineto
  closepath
} def

/g_general {
  0.2 0.15 moveto
  0.8 0.15 lineto
  0.8 0.5 lineto
  0.5 0.85 lineto
  0.2 0.5 lineto
  closepath
} def

/king {
  0.2 0.15 moveto
  0.8 0.15 lineto
  0.8 0.85 lineto
  0.5 0.65 lineto
  0.2 0.85 lineto
  closepath
} def

gsave
0.75 0.5 translate
{ pawn }   mkpiece
{ lance }  mkpiece
grestore

gsave
0.75 2 translate
{ knight } mkpiece
{ bishop }    mkpiece
grestore

gsave
0.75 3.5 translate
{ rook }      mkpiece
{ s_general } mkpiece
grestore

gsave
0.75 5 translate
{ g_general } mksingpiece
{ king }      mksingpiece
grestore

showpage