summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/metapost/bbcard
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2007-11-27 15:35:45 +0000
committerNorbert Preining <preining@logic.at>2007-11-27 15:35:45 +0000
commit29cbf8db28f83fd841f74f391592ec6e9df52eac (patch)
tree30505e3b683254827830d7e900c202c2522a2172 /Master/texmf-dist/metapost/bbcard
parent3d188c93838fdcc0d7c9041619fd041d87edbce1 (diff)
new metapost package bbcard
git-svn-id: svn://tug.org/texlive/trunk@5624 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/metapost/bbcard')
-rw-r--r--Master/texmf-dist/metapost/bbcard/bbcard.mp262
-rw-r--r--Master/texmf-dist/metapost/bbcard/breakwidth.mp101
-rw-r--r--Master/texmf-dist/metapost/bbcard/calendar.mp216
-rw-r--r--Master/texmf-dist/metapost/bbcard/scorecard.mp152
4 files changed, 731 insertions, 0 deletions
diff --git a/Master/texmf-dist/metapost/bbcard/bbcard.mp b/Master/texmf-dist/metapost/bbcard/bbcard.mp
new file mode 100644
index 00000000000..1d03256b68f
--- /dev/null
+++ b/Master/texmf-dist/metapost/bbcard/bbcard.mp
@@ -0,0 +1,262 @@
+
+% bullshit bingo card
+% prepared by patrick tj mcphee, december 2002 ptjm@interlog.com
+% released to the public domain. have fun
+
+% concept and many phrases taken from
+% http://www.perkigoth.com/home/kermit/stuff/BullshitBingo
+% others from the list of banished words of Lake Superior State University:
+% http://www.lssu.edu/banished
+% my thanks to all who have contributed to these efforts
+
+% to run off a single card, give a command like
+% mpost bbcard
+% and the card will written to bbcard.ps
+
+% to run off cards for several players, try
+% mpost '\nocards := 7; input bbcard'
+% and the cards will be written to bbcard.1, bbcard.2, .., bbcard.7
+
+% to add additional phrases, duplicate one of the lines starting with
+% i := i + 1; bs[i] :=
+% and replace the phrase in quotes
+% I keep them in alphabetical order to ease maintenance, but you don't
+% have to. I suggest commenting out phrases which are not known in
+% your community and adding the irritating ones which are.
+
+input breakwidth;
+
+defaultfont := "ptmr8r";
+
+prologues := 2;
+
+string bs[];
+i := 0;
+
+i := i + 1; bs[i] := "action item";
+i := i + 1; bs[i] := "actual facts";
+i := i + 1; bs[i] := "articulate";
+i := i + 1; bs[i] := "as we speak";
+i := i + 1; bs[i] := "at the end of the day";
+i := i + 1; bs[i] := "at this point in time";
+i := i + 1; bs[i] := "backward compatible";
+i := i + 1; bs[i] := "ballpark";
+i := i + 1; bs[i] := "bandwidth";
+i := i + 1; bs[i] := "basically";
+i := i + 1; bs[i] := "been there, done that";
+i := i + 1; bs[i] := "benchmark";
+i := i + 1; bs[i] := "best of breed";
+i := i + 1; bs[i] := "best practice";
+i := i + 1; bs[i] := "buzz";
+i := i + 1; bs[i] := "by and large";
+i := i + 1; bs[i] := "challenge";
+i := i + 1; bs[i] := "client-focused";
+i := i + 1; bs[i] := "collaborative";
+i := i + 1; bs[i] := "conceptualize";
+i := i + 1; bs[i] := "core business";
+i := i + 1; bs[i] := "core competency";
+i := i + 1; bs[i] := "critical path";
+i := i + 1; bs[i] := "down the road";
+i := i + 1; bs[i] := "down time";
+i := i + 1; bs[i] := "downsizing";
+i := i + 1; bs[i] := "drill down";
+i := i + 1; bs[i] := "dynamic";
+i := i + 1; bs[i] := "each and every";
+i := i + 1; bs[i] := "empower employees";
+i := i + 1; bs[i] := "extreme";
+i := i + 1; bs[i] := "fast-track";
+i := i + 1; bs[i] := "fault tolerant";
+i := i + 1; bs[i] := "front lines";
+i := i + 1; bs[i] := "game plan";
+i := i + 1; bs[i] := "gap analysis";
+i := i + 1; bs[i] := "go public";
+i := i + 1; bs[i] := "go the extra mile";
+i := i + 1; bs[i] := "going forward";
+i := i + 1; bs[i] := "hard-won lessons";
+i := i + 1; bs[i] := "hardball";
+i := i + 1; bs[i] := "having said that";
+i := i + 1; bs[i] := "heads up";
+i := i + 1; bs[i] := "issues";
+i := i + 1; bs[i] := "knock-on effect";
+i := i + 1; bs[i] := "knowledgebase";
+i := i + 1; bs[i] := "lessons learned";
+i := i + 1; bs[i] := "make no mistake";
+i := i + 1; bs[i] := "manage expectations";
+i := i + 1; bs[i] := "meaningful";
+i := i + 1; bs[i] := "metrics";
+i := i + 1; bs[i] := "mind share";
+i := i + 1; bs[i] := "mindset";
+i := i + 1; bs[i] := "mission critical";
+i := i + 1; bs[i] := "move the goal posts";
+i := i + 1; bs[i] := "movers and shakers";
+i := i + 1; bs[i] := "new economy";
+i := i + 1; bs[i] := "no blame";
+i := i + 1; bs[i] := "no-brainer";
+i := i + 1; bs[i] := "now, more than ever";
+i := i + 1; bs[i] := "off-site meeting";
+i := i + 1; bs[i] := "off-the-shelf";
+i := i + 1; bs[i] := "offload";
+i := i + 1; bs[i] := "on the same page";
+i := i + 1; bs[i] := "open source";
+i := i + 1; bs[i] := "out of the loop";
+i := i + 1; bs[i] := "out-source";
+i := i + 1; bs[i] := "outside the box";
+i := i + 1; bs[i] := "paradigm";
+i := i + 1; bs[i] := "partnership";
+i := i + 1; bs[i] := "proactive, not reactive";
+i := i + 1; bs[i] := "profitability";
+i := i + 1; bs[i] := "progressing";
+i := i + 1; bs[i] := "pushback";
+i := i + 1; bs[i] := "put this one to bed";
+i := i + 1; bs[i] := "results-driven";
+i := i + 1; bs[i] := "revenue";
+i := i + 1; bs[i] := "revisit";
+i := i + 1; bs[i] := "robust";
+i := i + 1; bs[i] := "run it up the flagpole";
+i := i + 1; bs[i] := "run the numbers";
+i := i + 1; bs[i] := "sales driven";
+i := i + 1; bs[i] := "scope";
+i := i + 1; bs[i] := "service oriented";
+i := i + 1; bs[i] := "slippery slide";
+i := i + 1; bs[i] := "speaks to";
+i := i + 1; bs[i] := "strategic fit";
+i := i + 1; bs[i] := "stretch the envelope";
+i := i + 1; bs[i] := "synergy";
+i := i + 1; bs[i] := "take that offline";
+i := i + 1; bs[i] := "target audience";
+i := i + 1; bs[i] := "team player";
+i := i + 1; bs[i] := "the big picture";
+i := i + 1; bs[i] := "the bottom line";
+i := i + 1; bs[i] := "think outside the box";
+i := i + 1; bs[i] := "ticks in boxes";
+i := i + 1; bs[i] := "time to market";
+i := i + 1; bs[i] := "timeline";
+i := i + 1; bs[i] := "to be perfectly honest";
+i := i + 1; bs[i] := "total quality";
+i := i + 1; bs[i] := "touch base";
+i := i + 1; bs[i] := "up to speed";
+i := i + 1; bs[i] := "user friendly";
+i := i + 1; bs[i] := "value-added";
+i := i + 1; bs[i] := "vast majority";
+i := i + 1; bs[i] := "very unique";
+i := i + 1; bs[i] := "walk the talk";
+i := i + 1; bs[i] := "web-enabled";
+i := i + 1; bs[i] := "win-win situation";
+i := i + 1; bs[i] := "wow factor";
+
+bsmax := i;
+
+radius := .5 cm;
+
+offset := 1 cm;
+boxwid := 1.9 cm;
+
+
+% co-ordinates for the grid
+pair bpos[], bpos[].ll, bpos[].ul, bpos[].ur, bpos[].lr;
+ for i = 0 upto 4:
+ for j = 0 upto 4:
+ bpos[i+j*5+1] := ((j+0.5)*boxwid, (i+0.5)*boxwid);
+ bpos[i+j*5+1].ll := (j*boxwid, i*boxwid);
+ bpos[i+j*5+1].ul := (j*boxwid, (i+1)*boxwid);
+ bpos[i+j*5+1].lr := ((j+1)*boxwid, i*boxwid);
+ bpos[i+j*5+1].ur := ((j+1)*boxwid, (i+1)*boxwid);
+ endfor;
+ endfor;
+
+picture bbcard[];
+
+% the grid itself
+bbcard[0] := image(
+ z1 = (0, radius) = z2 - (0, 5boxwid - 2radius) =
+ z6 - (5boxwid, 0) = z8 - (radius, -radius);
+ z3 = z8 + (0, 5boxwid) = z4 - (5boxwid-2radius, 0);
+ x5 = x6; y5 = y2;
+ x7 = x4;
+ y7 = y8;
+
+ pickup pencircle xscaled 4pt yscaled 1pt rotated 30;
+
+ draw z1---z2..z3---z4..z5---z6..z7---z8..cycle;
+
+ fill ((unitsquare shifted -(.5,.5)) scaled boxwid) shifted bpos[13] withcolor .8 white;
+
+ pickup pencircle scaled 1pt;
+ for i = 2 upto 5:
+ draw bpos[i].ll--bpos[i+20].lr;
+ endfor;
+
+ for i = 10 step 5 until 25:
+ draw bpos[i].ul--bpos[i-4].ll;
+ endfor;
+);
+
+% handle > 1 card if nocards was set on the command-line
+if known nocards:
+ for bsno = 1 upto nocards:
+else:
+ if unknown bsno:
+ bsno := -1;
+ fi;
+fi;
+
+ % select the strings for each card
+ % after we're done, we set the middle square to `Free Square'
+ % dups[] is used to keep track of already used values to eliminate
+ % duplicates within each grid (a playing card has four grids on it)
+
+ for bb = 1 upto 4:
+ string bstring[];
+ numeric dups[];
+
+ for i = 1 upto 25:
+ j := 1+floor(uniformdeviate bsmax);
+
+ forever:
+ exitif unknown dups[j];
+ j := 1+floor(uniformdeviate bsmax);
+ endfor;
+ dups[j] := i;
+ bstring[i] = bs[j];
+ endfor;
+
+ bstring[13] := "Free Square";
+
+ bbcard[bb] := image(
+ draw bbcard[0];
+ for i = 1 upto 25:
+ label(breaktowidth(bstring[i], 1.5cm, 11pt), bpos[i]);
+ endfor;
+ );
+ endfor;
+
+ beginfig(bsno);
+ picture p;
+ p := ("Bullshit Bingo" infont defaultfont scaled 2)
+ shifted ((offset, 3offset)+2.25*ulcorner bbcard[0]);
+
+ fill ((llcorner p)..(ulcorner p).. tension 2 .. (urcorner p)..
+ (lrcorner p) .. tension 2 .. cycle)
+ withcolor .5 white;
+ draw p withcolor white;
+
+ draw ("Advanced Playing Card" infont defaultfont scaled 1.2)
+ shifted ((lrcorner p) + (10pt, 6pt));
+ draw ("Stay awake!" infont defaultfont)
+ shifted ((lrcorner p) + (10pt, -14pt));
+ draw ("Watch for duplicates!" infont defaultfont)
+ shifted ((lrcorner p) + (10pt, -25pt));
+ draw ("Have fun!" infont defaultfont)
+ shifted ((lrcorner p) + (10pt, -36pt));
+
+ draw bbcard[1] shifted (offset, offset);
+ draw bbcard[2] shifted ((1.25offset, offset)+lrcorner bbcard[0]);
+ draw bbcard[3] shifted ((1.25offset, 2offset)+urcorner bbcard[0]);
+ draw bbcard[4] shifted ((offset, 2offset)+ulcorner bbcard[0]);
+ endfig;
+
+if known nocards:
+ endfor;
+fi;
+
+end;
diff --git a/Master/texmf-dist/metapost/bbcard/breakwidth.mp b/Master/texmf-dist/metapost/bbcard/breakwidth.mp
new file mode 100644
index 00000000000..54777cd81f1
--- /dev/null
+++ b/Master/texmf-dist/metapost/bbcard/breakwidth.mp
@@ -0,0 +1,101 @@
+%%
+%% naive paragraph formatting for metapost. You get better results using
+%% btex .. etex, since that will give you kerning, ligatures, and the
+%% famous TeX paragraph breaking algorithm. This one is OK for me, though,
+%%
+%% Copyright 2001,2003 Patrick TJ McPhee
+%% everyone is welcome to use this code for any purpose, to modify it, and
+%% to copy it in whole or in part for use in other macro sets, with the
+%% conditions that this copyright notice be preserved with any significant
+%% portion of the code, and that modifications to this file be clearly
+%% marked.
+
+
+% arguments
+% s - text to format
+% w - maximum width
+% b = baseline skip
+
+vardef breaktowidth(expr s, w, b) =
+ save p;
+ picture p;
+
+ p := s infont defaultfont scaled defaultscale;
+ % if the string is too long to fit within bounds, we break it up on
+ % word boundaries.
+ if xpart(lrcorner p) > w:
+ save q, gq, offs, len, goodlen, gl, ls, sp;
+
+ picture q, gq;
+ numeric offs, len, goodlen, ls, gl;
+ string sp;
+
+ p := nullpicture;
+ offs := 0; % offset of current substring within s
+ len := 1; % most recent character examined
+ goodlen := 0; % most recent reasonable break point
+ ls := length(s);
+
+ forever:
+ if len < ls:
+ sp := substring(len, len+1) of s;
+ else:
+ sp := " ";
+ fi;
+
+ if (sp = " ") or (sp = "-") or (sp = "/"):
+
+ if sp <>" ":
+ len := len + 1;
+ fi;
+
+ % test to see if this is within the needed width
+ q := (substring(offs, len) of s) infont defaultfont scaled defaultscale;
+
+
+ if xpart (lrcorner q) > w:
+ % if there's no good break point, build up until we
+ % get something that fits -- can't use goodlen as the
+ % array index as it is reset to 0 after the loop ends
+ if goodlen <= offs:
+ for gl = (len-1) downto (offs+1):
+ goodlen := gl;
+ gq := (substring(offs, goodlen) of s) infont defaultfont scaled defaultscale;
+ exitunless xpart (lrcorner gq) > w;
+ endfor;
+ fi;
+
+
+ p := image(draw p shifted (0, b);
+ draw gq;);
+ offs := goodlen;
+ len := offs + 1;
+
+ % we still fit, so save the current position
+ else:
+ if sp <> " ":
+ goodlen := len;
+ else:
+ goodlen := len+1;
+ fi;
+ gq := q;
+ fi;
+ fi;
+
+ exitunless len < ls;
+
+ len := len + 1;
+ endfor;
+
+ if goodlen < ls:
+ gq := (substring(offs, ls) of s) infont defaultfont scaled defaultscale;
+ fi;
+
+ if goodlen <> ls:
+ p := image(draw p shifted (0, b);
+ draw gq;);
+ fi;
+ fi;
+ p
+enddef;
+
diff --git a/Master/texmf-dist/metapost/bbcard/calendar.mp b/Master/texmf-dist/metapost/bbcard/calendar.mp
new file mode 100644
index 00000000000..27c0db6de6f
--- /dev/null
+++ b/Master/texmf-dist/metapost/bbcard/calendar.mp
@@ -0,0 +1,216 @@
+%% One-page calendar
+%% Patrick TJ McPhee, 1997
+%% you are permitted to modify or distribute this file
+%% any way you like, but please indicate modifications
+%%
+%% Instructions: if you run this file through metafont, it will produce a
+%% one-month calendar for next month, suitable for printing on US letter-size
+%% paper. You can set two parameters, theyear affects the year for which the
+%% calendar will be printed, and themonth affects the month. The valid
+%% range for theyear is 1997 to some year well off in the future, and the
+%% valid range for themonth is -1 to 12. If themonth is set to -1, calendars
+%% will be printed for every month in the year. If themonth is set to 0,
+%% a calendar will be printed for the following month.
+%% The ouput file for each month is calendar.<themonth>. e.g., the
+%% file for April would be calendar.4.
+
+%% fonts used to put up numbers, days of the week and holidays
+string brandfont;
+brandfont := "pplr8r";
+defaultfont:="pplr8r";
+defaultscale := 2;
+prologues:=1;
+
+%% list of holidays. The first element of the array is the month, and the
+%% second is the day of the month
+string brands[][];
+
+brands[12][25] := "Christmas";
+brands[1][1] = "Hogmany";
+brands[1][25] = "Robbie Burns";
+brands[2][14] = "Valentine";
+brands[11][11] = "Remembrance";
+brands[11][1] = "All Saints";
+brands[11][2] = "All Souls";
+brands[7][1] = "Canada Day";
+
+%% days of the week
+string weekdays[];
+weekdays[1] = "Sunday";
+weekdays[2] = "Monday";
+weekdays[3] = "Tuesday";
+weekdays[4] = "Wednesday";
+weekdays[5] = "Thursday";
+weekdays[6] = "Friday";
+weekdays[7] = "Saturday";
+
+%% names of the months
+string mnames[];
+
+mnames[1] = "January";
+mnames[2] = "February";
+mnames[3] = "March";
+mnames[4] = "April";
+mnames[5] = "May";
+mnames[6] = "June";
+mnames[7] = "July";
+mnames[8] = "August";
+mnames[9] = "September";
+mnames[10] = "October";
+mnames[11] = "November";
+mnames[12] = "December";
+
+%% I don't think anything needs to change below this point to support
+%% other languages or other anticipated modifications
+
+% the same as `label', but specify the size
+vardef alabel@#(expr s,z,sz) = % Position s near z size sz
+ save p; picture p;
+ if picture s: p=s
+ else: p = s infont brandfont scaled sz
+ fi;
+ p shifted (z + labeloffset*laboff@# -
+ (labxf@#*lrcorner p + labyf@#*ulcorner p
+ + (1-labxf@#-labyf@#)*llcorner p
+ )
+ )
+enddef;
+
+def brand = draw alabel enddef;
+
+hoff:=.5in;
+voff:= hoff;
+
+width:= 10in;
+height := 7.5in;
+margin := .05in;
+daynameh := .5 in;
+
+daywidth := (width - 2margin)/7;
+dayheight := (height - 2margin - daynameh)/5;
+
+picture frame;
+
+ pickup pencircle scaled 2 pt yscaled .6 pt rotated 135;
+% pickup penrazor scaled 2 pt rotated 135;
+ bot y1 = voff = bot y8 = top y4 - height = top y5 - height;
+ lft x2 = hoff = lft x3 = rt x6 - width = rt x7 - width;
+ x1 - x4 = 0 = y2 - y7 = y3 - y6 = x5 - x8;
+ x1 - x2 = hoff = y2 - y1 = y4 - y3 = x7 - x8;
+
+% draw z1..z2---z3..z4---z5..z6---z7..z8---cycle;
+ draw (x3-.25hoff,y4+.25voff){dir(-45)}..z4---z5..z6---z7..{dir(-45)}(x7+.25hoff, .75voff)
+ {dir(135)}..z8---z1..z2---z3..{dir(135)}cycle;
+
+
+ pickup pencircle scaled .6 pt;
+ z1 - z9 = (margin, -margin) = z6 - z14 = z10 - z2 = z13 - z5;
+ z3 - z11 = (-margin, -margin) = z8 - z16 = z12 - z4 = z15 - z7;
+
+ draw z9..z10---z11..z12---z13..z14---z15..z16---cycle;
+
+ for i := 1 upto 6:
+ draw (x10+i*daywidth, y9)--(x10+i*daywidth, y12);
+ endfor;
+
+ for i := 1 upto 5:
+ draw (x10, y9+i*dayheight)--(x15, y9+i*dayheight);
+ endfor;
+
+ for i := 1 upto 7:
+ label(weekdays[i], (x10+(i-.5)*daywidth, y9+5daywidth+.2 daynameh));
+ endfor;
+
+lftedge := x10;
+rtedge := x15;
+botedge := y9;
+
+frame := currentpicture;
+
+clearit;
+
+mdays[1] = 31;
+mdays[2] = 28;
+mdays[3] = 31;
+mdays[4] = 30;
+mdays[5] = 31;
+mdays[6] = 30;
+mdays[7] = 31;
+mdays[8] = 31;
+mdays[9] = 30;
+mdays[10] = 31;
+mdays[11] = 30;
+mdays[12] = 31;
+
+def drawmonth (expr mon, startday) :=
+beginfig(mon);
+ draw frame;
+
+ numhoff := lftedge + startday*daywidth;
+ numvoff := botedge + 5 * dayheight;
+
+ if startday > 1:
+ undraw (lftedge+daywidth, numvoff-.25 dayheight)..(lftedge+daywidth, numvoff-.75 dayheight);
+ brand (mnames[mon], (lftedge+daywidth,numvoff-.5 dayheight), 3);
+ brand (decimal theyear, (lftedge+daywidth,numvoff-.7 dayheight), 1);
+ fi;
+
+ for i := 1 upto mdays[mon]:
+ if numvoff > botedge:
+ label.lrt(decimal i, (numhoff, numvoff));
+ else:
+ label.ulft(decimal i, (numhoff+daywidth, numvoff));
+ fi;
+ numhoff := numhoff + daywidth;
+
+ if known brands[mon][i]: brand.llft(brands[mon][i], (numhoff,numvoff), 1); fi
+
+ if numhoff >= rtedge:
+ numhoff := lftedge;
+ numvoff := numvoff - dayheight;
+ fi
+ endfor;
+
+ if startday <= 1:
+ undraw (lftedge+6daywidth, numvoff-.25 dayheight)..(lftedge+6daywidth, numvoff-.75 dayheight);
+ brand (mnames[mon], (lftedge+6daywidth,numvoff-.5 dayheight), 3);
+ brand (decimal theyear, (lftedge+6daywidth,numvoff-.7 dayheight), 1);
+ fi;
+
+ currentpicture := currentpicture rotatedaround((4.25in,4.25in),90);
+endfig;
+enddef;
+
+%% if no year is specified, try for the current year
+if unknown theyear: theyear:=year;
+elseif theyear=0: theyear:=year;
+fi;
+firstday := (3 + (theyear - 1997) + (theyear - 1997) div 4) mod 7;
+
+%% if no month is specified, try for next month
+if unknown themonth: themonth := month + 1;
+elseif themonth=0: themonth := month + 1;
+fi;
+if themonth = 13:
+ theyear := theyear+1;
+ themonth := 1;
+ fi;
+
+if ((theyear mod 4) = 0)
+ and (((theyear mod 100) <> 0) or ((theyear mod 400) = 0)):
+ mdays[2] := 29;
+ fi;
+
+% special value of themonth: -1 prints the whole year's calendar
+if themonth = -1:
+ for j = 1 upto 12:
+ drawmonth(j, firstday);
+ firstday := (firstday + mdays[j]) mod 7;
+ endfor;
+else:
+ for j = 1 upto (themonth-1):
+ firstday := (firstday + mdays[j]) mod 7;
+ endfor;
+ drawmonth(themonth, firstday);
+fi
+end;
diff --git a/Master/texmf-dist/metapost/bbcard/scorecard.mp b/Master/texmf-dist/metapost/bbcard/scorecard.mp
new file mode 100644
index 00000000000..5b9bcb796c0
--- /dev/null
+++ b/Master/texmf-dist/metapost/bbcard/scorecard.mp
@@ -0,0 +1,152 @@
+%
+% Ball score card
+
+defaultfont:="rptmr";
+defaultscale := 1;
+prologues := 1;
+special "/rptmr /Times-Roman def";
+
+% pen for the outer box
+pickup pencircle scaled 1 pt;
+fat nib = savepen;
+
+% pen for the cross-lines
+pickup pencircle scaled .5 pt;
+medium nib = savepen;
+
+% pen for slashes
+pickup pencircle scaled .1 pt;
+thin nib = savepen;
+
+un = 1 cm;
+
+def urc (expr x,y) =
+ ((x,y)-(.2un,0)){right}..{down}((x,y)-(0,.2un))
+enddef;
+def lrc (expr x, y) =
+ ((x,y)+(0,.2un)){down}..{left}((x,y)-(.2un,0))
+enddef;
+def llc (expr x, y) =
+ ((x,y)+(.2un,0)){left}..{up}((x,y)+(0,.2un))
+enddef;
+def ulc (expr x, y) =
+ ((x,y)-(0,.2un)){up}..{right}((x,y)+(.2un,0))
+enddef;
+
+
+beginfig(-1);
+
+ picture pitcherbox, batterbox;
+
+ batterbox = image (
+ % outer frame
+ pickup fat nib;
+ draw llc (0,0)---ulc (0,11un)---urc(20un,11un)---lrc (20un,0)---cycle;
+
+ % and some frame-like lines
+ draw (0,1un)---(20un,1un);
+ draw (0,10un)---(20un,10un);
+ draw (4un,0)---(4un,11un);
+
+ % name separators
+ pickup medium nib;
+ for i = 2un step un until 9 un:
+ draw (0,i)---(20un,i);
+ endfor;
+
+ for i := 5 un step un until 19 un:
+ draw (i, 0)---(i, 11un);
+ endfor;
+% added by Dave Rebnord
+ for i := 4 un step un until 14 un:
+ for j := 1 un step un until 9 un :
+ draw (i+0.2un,j+0.5un)---(i+0.5un, j+0.8un)---(i+0.8un,j+0.5un)---(i+0.5un,j+0.2un)---cycle withcolor .25[white, black];
+ endfor;
+ endfor;
+
+ % slashes and other light lines
+ pickup thin nib;
+ for i := 4un step un until 15un:
+ draw (i,0)---(i+un, un);
+ endfor;
+
+ for i := un step un until 9un:
+ draw (0, i+.5un)---(4un, i+.5un);
+ draw (15un, i)---(16un, i+un);
+ draw (19un, i)---(20un, i+un);
+ endfor;
+
+
+ draw (15un, 0)---(16un, un);
+ draw (19un, 0)---(20un, un);
+ draw (15un, 10un)---(16un, 11un);
+ draw (19un, 10un)---point .5 of (urc (20un,11un));
+
+
+ % labels
+ for i := 1 upto 11:
+ label(decimal i, ((3.5+i)*un, 10.5un));
+ endfor;
+
+ label.rt("Totals", (0, .5un));
+
+ label.lft("Runs", (4un, 2/3un));
+ label.lft("Hits", (4un, 1/3un));
+
+
+ label.bot("ab", (15.3un, 11un));
+ label.top("ap", (15.7un, 10un));
+
+ label("r", (16.5un, 10.5un));
+ label("h", (17.5un, 10.5un));
+ label("rbi", (18.5un, 10.5un));
+
+ label.bot("ob", (19.3un, 11un));
+ label.top("e", (19.7un, 10un));
+ );
+
+
+ pitcherbox = image (
+ % outer frame
+ pickup fat nib;
+ ph = 4.5un/5;
+ draw llc (0,0)---ulc (0, 5ph)---urc (20un,5ph)---lrc (20un,0)---cycle;
+
+ % and some frame-like lines
+ draw urc (10un,5ph)---lrc (10un, 4ph)---llc (0,4ph);
+
+ draw urc (10un, 4ph)---(10un,0);
+ draw (4un,0)..(4un,5ph);
+
+ % name separators
+ pickup medium nib;
+
+ draw ulc (10un, 4ph)---(20un,4ph);
+ draw llc (10un, 4ph);
+
+ for i = ph step ph until 3ph:
+ draw (0,i)---(20un,i);
+ endfor;
+
+ for i := 0 step un until 4un:
+ draw (5un+i,0)---(5un+i, 5ph);
+ draw (14un+i,0)---(14un+i, 5ph);
+ endfor;
+ draw (19un,0)---(19un, 5ph);
+
+ label("Pitchers", (2un, 4.5ph));
+ label("IP", (4.5un, 4.5ph));
+ label("H", (5.5un, 4.5ph));
+ label("R", (6.5un, 4.5ph));
+ label("ER", (7.5un, 4.5ph));
+ label("K", (8.5un, 4.5ph));
+ label("BB", (9.5un, 4.5ph));
+ );
+
+
+ draw batterbox shifted (.75un, .75un);
+ draw pitcherbox shifted (.75un, 11.85un);
+ draw batterbox shifted (.75un, 16.45un);
+
+endfig;
+end;