Skip to content

Commit

Permalink
Merge branch 'grs31'
Browse files Browse the repository at this point in the history
  • Loading branch information
seansweda committed Apr 26, 2014
2 parents 33b9254 + 876b778 commit 2403271
Show file tree
Hide file tree
Showing 21 changed files with 1,078 additions and 716 deletions.
14 changes: 9 additions & 5 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
// $Id$

This is the latest and greatest grs construction program.

VERSION HISTORY
-----------------------------------------------------------------------
3.1.0 * track batters faced (BF)
* display current pitcher's IP & BF totals
* prevent overwriting of existing output files
* check for valid defensive lineup
* fix undo after dc bug

3.0.1 * fix baserunner queue bug
* sanity check for outs on play
* pb was incorrectly crediting team with error
Expand Down Expand Up @@ -66,7 +70,7 @@ VERSION HISTORY
the dreaded "segmentation fault".
Also, added the -v flag to output the version of grs.

2.2.0 Changed play-by-play output to remove redundancies, after
2.2.0 Changed play-by-play output to remove redundancies, after
incessant whining by Richard Dunlap (Macon Peaches). :-)

2.1.2 Fixed bug in "np" which would not output correct MLB team
Expand All @@ -90,9 +94,9 @@ VERSION HISTORY

1.1.1 Starting pitchers now listed in .pbp file.

1.1.0 Inherited runners now charged to correct pitcher.
1.1.0 Inherited runners now charged to correct pitcher.

1.0.0 Undo semi-functional. Also, the "eg" command works.
1.0.0 Undo semi-functional. Also, the "eg" command works.
LOB now tabulated.

0.90 the extra stats (E, PB, GIDP, etc.) no longer have to be entered
Expand Down
36 changes: 21 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,43 +1,49 @@
# $Id$

# -DDEBUG turns on debugging output
# -DWIN32 for building on Windows

CC = g++
CFLAGS = -g -Wall -Wextra -Wconversion #-DDEBUG
# if you don't have getopt() use -DGETOPT and uncomment next line
#GETOPT = getopt.o

GIT_VERSION := $(shell git describe --abbrev=6 --dirty --always)
CC = gcc
CPP = g++
CFLAGS = -g -Wall -Wextra -Wconversion -DGIT=\"$(GIT_VERSION)\" #-DDEBUG
LDFLAGS =

all: grs

tarball:
rm -f grs.tar grs.tar.gz
tar cf grs.tar README CHANGES TODO Makefile *.h *.cc grscat
tar cf grs.tar README CHANGES TODO Makefile *.h *.cc getopt grscat
gzip grs.tar

grs: Makefile main.o frame.o update.o queue.o team.o player.o pitcher.o
$(CC) $(CFLAGS) $(LDFLAGS) -o grs main.o frame.o update.o queue.o team.o player.o pitcher.o
grs: Makefile main.o frame.o update.o queue.o team.o player.o pitcher.o $(GETOPT)
$(CPP) $(CFLAGS) $(LDFLAGS) -o grs main.o frame.o update.o queue.o team.o player.o pitcher.o $(GETOPT)

main.o: Makefile main.cc frame.h team.h player.h pitcher.h config.h
$(CC) $(CFLAGS) -c main.cc
$(CPP) $(CFLAGS) -c main.cc

frame.o: Makefile frame.cc update.cc frame.h queue.h team.h player.h pitcher.h extern.h config.h
$(CC) $(CFLAGS) -c frame.cc
$(CPP) $(CFLAGS) -c frame.cc

update.o: Makefile frame.cc update.cc frame.h queue.h team.h player.h pitcher.h extern.h config.h
$(CC) $(CFLAGS) -c update.cc
$(CPP) $(CFLAGS) -c update.cc

team.o: Makefile team.cc team.h player.h pitcher.h config.h
$(CC) $(CFLAGS) -c team.cc
$(CPP) $(CFLAGS) -c team.cc

queue.o: Makefile queue.cc queue.h pitcher.h
$(CC) $(CFLAGS) -c queue.cc
$(CPP) $(CFLAGS) -c queue.cc

player.o: Makefile player.cc player.h config.h
$(CC) $(CFLAGS) -c player.cc
$(CPP) $(CFLAGS) -c player.cc

pitcher.o: Makefile pitcher.cc pitcher.h config.h
$(CC) $(CFLAGS) -c pitcher.cc
$(CPP) $(CFLAGS) -c pitcher.cc

getopt.o: Makefile getopt/getopt.c getopt/getopt.h
$(CC) $(CFLAGS) -c getopt/getopt.c

clean:
clean:
rm -f *.o grs grs.tar.gz

41 changes: 23 additions & 18 deletions README
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// $Id$

GRS is a program for creating a game report for the Internet Baseball
League. GRS was written by Sean Sweda ([email protected]), with assistance
from Greg Speegle, Richard Dunlap, and Christian Beliveau. The code is
available via anonymous ftp at ftp://ftp.ibl.org/ibl/grs/
from Greg Speegle, Richard Dunlap, and Christian Beliveau. The source
code is available at github <https://github.com/seansweda/grs> or via
anonymous ftp <ftp://ftp.ibl.org/ibl/grs/>

** please submit bug reports to [email protected] **

Expand All @@ -27,13 +26,16 @@ Usage: grs [ (-a afile) (-h hfile) | (-f cmdfile) ] outfile
-h Used to read in the home team's lineup from an external file.
ex: grs -h my_lineup_vsRH game6

-f Used to read in commands from an external file. NOTE: This
-f Used to read in commands from an external file. NOTE: This
includes the lineups, thus -f is incompatible with -a and/or -h.
ex: grs -f unfinished_game 1-1

-v Using this flag will cause grs to output the version number.
(v2.3.0 and later)

-o Used to overwrite existing output files.
(v3.1 and later)

If you use the -f flag to read in a file, make sure that the last
event is NOT 'eg'.

Expand All @@ -43,7 +45,7 @@ the following files:
<outfile>.sts - the stats
<outfile>.pbp - the play-by-play
<outfile>.cmd - the commands you typed in
<outfile>.un# - a file GRS uses temporarily to process the undo command
<outfile>.un# - a file GRS uses temporarily to process the undo command
there may be several of these files after you are done

The accompanying shell script, grscat (instructions at the end) will
Expand All @@ -57,7 +59,7 @@ handle gracefully, if you come across one please inform the author.

ENTERING THE LINEUPS

GRS uses space dilimited text. Thus, when prompted for player name,
GRS uses space dilimited text. Thus, when prompted for player name,
real team, and position, you should separate these by spaces.
Example: Trammell DET ss

Expand All @@ -79,7 +81,7 @@ GRS accepts commands in the following syntax: (space delimited)

event location baserunning

event - a 2 letter event code, all of which are listed below
event - a 2 letter event code, all of which are listed below
location - many uses, eg. location of a hit (gcf), or fielding
on the play (6-3); also can be used to indicate a
special kind of play like a H&R or IFR, eg. 6-3(IFR)
Expand All @@ -106,18 +108,18 @@ ph - pinch hit

pr - pinch run

Use the same form as lineup entry. List the position the
pinch-runner will play next inning, or just "pr" if he
is only pinch-running.
Use the same form as lineup entry. List the position the
pinch-runner will play next inning, or just "pr" if he
is only pinch-running.

np - new pitcher

Use the same form as lineup entry. Also, if you are playing
with the pitcher batting, you can specify the position in the
batting order where the pitcher will hit, and GRS will
automatically insert him into the batting order.
ex: Harvey FLA R 9 (this would put Harvey in the 9 hole)
ex: Harvey FLA R 9 (this would put Harvey in the 9 hole)

dr - defensive replacement
dc - defensive position change

Expand All @@ -138,7 +140,7 @@ un - undo
file normally, and this will only serve to confuse GRS.

en - end of inning
eg - end of game
eg - end of game

cm - comment
nj - enters in a "<runner> unable to get jump" comment, specify base of runner
Expand All @@ -162,11 +164,14 @@ cs - caught stealing
pk - picked off
th - advance on a throw
oa - out advancing on a throw
ri - baserunner out due to interference
di - defensive indifference

1b - single
2b - double
3b - triple
hr - home run
tp - triple play
dp, gd - ground into double play
fd - fly into double play
ld - line into double play
Expand All @@ -180,7 +185,7 @@ po - pop out
fp, pf - foul pop out
sf - sacrifice fly
sh - sacrifice hit
lf - long fly
lf - long fly
wt, df - warning track fly (from deep fly chart)
er - batter reaches on error
ea - runner advances on error
Expand All @@ -202,7 +207,7 @@ Undo seems to be 100% functional.

NEVER, EVER, use the -f flag with an undo command imbedded in the
input file! the undo event is never recorded in a .cmd file, and GRS
is not expecting it! there will be grave (although quite comical)
is not expecting it! there will be grave (although quite comical)
consequences if you ignore this.

The moral of the story is, use undo at your own risk. What is listed
Expand All @@ -222,7 +227,7 @@ e.g. grs 8-1 - for week 8, game 1

grscat takes a single argument, the week number

e.g grscat 8 - will cat all week 8 games into a file named "8"
e.g grscat 8 - will cat all week 8 games into a file named "8"

also, if you put mail header info into a file called .grscat in the
same directory as the files you are grscat-ing, it will put it at
Expand All @@ -233,7 +238,7 @@ e.g. my .grscat is
To:
cc:
Subject:
-------
-------

WEEK
AWAY
Expand Down
9 changes: 1 addition & 8 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
// $Id$

Known Bugs
- none!

Events
- triple play
- baserunner interference
Missing Events

Feature Requests
- check for valid lineup after dr/dc/en
- dice rolling
- allow use of 4 instead of "h" for baserunning
- baserunners allowed for current pitcher
- handle STARTS/INJURIES
- interactive lineup entry

2 changes: 0 additions & 2 deletions config.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// $Id$

#ifdef WIN32
# define NULLDEV "NUL:"
#else
Expand Down
2 changes: 0 additions & 2 deletions extern.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// $Id$

#include "config.h"

#ifndef __EXTERN_H
Expand Down
Loading

0 comments on commit 2403271

Please sign in to comment.