[net.sources.games] Hacks on SAIL

bill@persci.UUCP (04/10/85)

The following shar file contains 'diff -c' files, to modify SAIL.
There are two modifications: A change to the scoring system,
and a modification to the display useful to landlubbers.

Bill Swan	{ihnp4|decvax|..}!uw-beaver!tikal!persci!bill
Personal Scientific
Woodinville WA

--------------------------cut-here--------------------
#!/bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #!/bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
#	README
#	diff.Makefile
#	diff.misc.c
#	diff.player1.c
#	diff.player7.c
#	diff.sail.6
#	diff.sail.log.c
#	diff.version.c
# This archive created: Tue Apr  9 13:01:32 1985
export PATH; PATH=/bin:$PATH
echo shar: extracting "'README'" '(2384 characters)'
if test -f 'README'
then
	echo shar: over-writing existing file "'README'"
fi
sed 's/^X//' << \SHAR_EOF > 'README'
XThis is an update to SAIL.  This shar file contains only context-type (-c)
X'diff's on the files that were altered in the change.  The changes were
Xmade quickly, so I am sure that there are better ways to do some of things
XI've done here. Any improvements you could make and post to the net (or
Xmail me at ..uw-beaver!tikal!persci!bill) would be gratefully accepted.
X
XThe changes to SAIL contained in this package are:
X	1. The bell is turned off. The constant beeping was a terrible
X	   nuisance in our working environment here (especially with our
X	   terminals which take about a second to emit a beep, and QUEUE
X	   UP beeps! They could go for 60 seconds continuously in some of
X	   the bigger battles!).   It would be nice if the game could know
X	   about visual bells.
X	2. The wind-rose is altered, by request of many of our players. It
X	   now displays the speed you can travel in direct relation to the
X	   screen directions instead of relative to windward. This defeats an
X	   intent of the original game writers, and should only be done by
X	   lesser SAILors. This change is completely incorporated in the
X	   module: draw_stat() in player7.c. To use the original windrose,
X	   don't install this file!
X	3. The score logging system has been made to work like rogue's. We
X	   had a situation where the two best players took all 10 slots! 
X	   Nobody else could even get on.  Now, each user gets only one entry,
X	   so that everybody can participate.  
X	   As an inducement to new players (at least when you have less than
X	   10 players), if you get on the scoreboard with a score of zero,
X	   you don't get a title, you get keelhauled (by your exasperated
X	   crew, no doubt!).
X	   For a long time we played without even being aware that score was
X	   being kept. I even looked at the log file without realizing what 
X	   it was!! For this reason, the game will display the score every
X	   time you exit. If you raised your score, that entry will be
X	   displayed in standout mode.
X	   Finally, I have altered the display format slightly. This could be
X	   improved further, but I don't have the time now.
X
XMy Wishlist:
X	1. Use visual bells.
X	2. Improve score display format.
X
XWe have found SAIL to be a lot of fun to play. Our hats are off to the
Xoriginal creators!!!   SAIL HO!!!
X
XBill Swan	{decvax|ihnp4|...}!uw-beaver!tikal!persci!bill
XPersonal Scientific
XWoodinville WA 
SHAR_EOF
if test 2384 -ne "`wc -c 'README'`"
then
	echo shar: error transmitting "'README'" '(should have been 2384 characters)'
fi
echo shar: extracting "'diff.Makefile'" '(726 characters)'
if test -f 'diff.Makefile'
then
	echo shar: over-writing existing file "'diff.Makefile'"
fi
sed 's/^X//' << \SHAR_EOF > 'diff.Makefile'
X*** sail/Makefile	Fri Feb  1 12:22:37 1985
X--- Makefile	Mon Apr  8 15:14:11 1985
X***************
X*** 1,7
X  #
X  # Sail - Wooden Ships And Iron Men
X  #
X- # Makefile	@(#)Makefile	2.6 84/12/03
X  #
X  CC=	cc
X  CTAGS=	ctags -w
X
X--- 1,6 -----
X  #
X  # Sail - Wooden Ships And Iron Men
X  #
X  #
X  CC=	cc
X  CTAGS=	ctags -w
X***************
X*** 39,45
X  	cc -O ${COMMONOBJS} ${DOBJS} ${DLIBS} -o driver
X  
X  sail.log: ${LOBJS} globals.o
X! 	cc -O ${LOBJS} globals.o -o sail.log
X  
X  lint:
X  	lint -z $(PFILES) $(COMMONFILES) -lcurses
X
X--- 38,44 -----
X  	cc -O ${COMMONOBJS} ${DOBJS} ${DLIBS} -o driver
X  
X  sail.log: ${LOBJS} globals.o
X! 	cc -O ${LOBJS} globals.o -ltermcap -o sail.log
X  
X  lint:
X  	lint -z $(PFILES) $(COMMONFILES) -lcurses
SHAR_EOF
if test 726 -ne "`wc -c 'diff.Makefile'`"
then
	echo shar: error transmitting "'diff.Makefile'" '(should have been 726 characters)'
fi
echo shar: extracting "'diff.misc.c'" '(7639 characters)'
if test -f 'diff.misc.c'
then
	echo shar: over-writing existing file "'diff.misc.c'"
fi
sed 's/^X//' << \SHAR_EOF > 'diff.misc.c'
X*** sail/misc.c	Fri Feb  1 14:18:23 1985
X--- misc.c	Mon Apr  8 15:14:15 1985
X***************
X*** 1,5
X  #ifndef lint
X! static	char *sccsid = "@(#)misc.c	2.3 84/02/23";
X  #endif
X  #include "externs.h"
X  
X
X--- 1,5 -----
X  #ifndef lint
X! 		char *sccsid = "@(#)misc.c	3.0 85/03/06";
X  #endif
X  #include "externs.h"
X  
X***************
X*** 148,153
X  }
X  
X  #include <sys/file.h>
X  log(s)
X  register struct ship *s;
X  {
X
X--- 148,154 -----
X  }
X  
X  #include <sys/file.h>
X+ int
X  log(s)
X  register struct ship *s;
X  {
X***************
X*** 154,159
X  	FILE *fp;
X  	int persons;
X  	int n;
X  	struct logs log[NLOG];
X  	float net;
X  	register struct logs *lp;
X
X--- 155,162 -----
X  	FILE *fp;
X  	int persons;
X  	int n;
X+ 	int posit = 1;
X+ 	int my_uid;
X  	struct logs log[NLOG];
X  	float net;
X  	register struct logs *lp;
X***************
X*** 159,165
X  	register struct logs *lp;
X  
X  	if ((fp = fopen(LOGFILE, "r+")) == NULL)
X! 		return;
X  #ifdef LOCK_EX
X  	if (flock(fileno(fp), LOCK_EX) < 0)
X  		return;
X
X--- 162,168 -----
X  	register struct logs *lp;
X  
X  	if ((fp = fopen(LOGFILE, "r+")) == NULL)
X! 		return(0);
X  #ifdef LOCK_EX
X  	if (flock(fileno(fp), LOCK_EX) < 0)
X  		return(0);
X***************
X*** 162,168
X  		return;
X  #ifdef LOCK_EX
X  	if (flock(fileno(fp), LOCK_EX) < 0)
X! 		return;
X  #endif
X  	net = (float)s->file->points / s->specs->pts;
X  	persons = getw(fp);
X
X--- 165,171 -----
X  		return(0);
X  #ifdef LOCK_EX
X  	if (flock(fileno(fp), LOCK_EX) < 0)
X! 		return(0);
X  #endif
X  	my_uid = getuid();
X  	net = (float)s->file->points / s->specs->pts;
X***************
X*** 164,169
X  	if (flock(fileno(fp), LOCK_EX) < 0)
X  		return;
X  #endif
X  	net = (float)s->file->points / s->specs->pts;
X  	persons = getw(fp);
X  	n = fread((char *)log, sizeof(struct logs), NLOG, fp);
X
X--- 167,173 -----
X  	if (flock(fileno(fp), LOCK_EX) < 0)
X  		return(0);
X  #endif
X+ 	my_uid = getuid();
X  	net = (float)s->file->points / s->specs->pts;
X  	persons = getw(fp);					/*read file*/
X  	n = fread((char *)log, sizeof(struct logs), NLOG, fp);
X***************
X*** 165,171
X  		return;
X  #endif
X  	net = (float)s->file->points / s->specs->pts;
X! 	persons = getw(fp);
X  	n = fread((char *)log, sizeof(struct logs), NLOG, fp);
X  	for (lp = &log[n]; lp < &log[NLOG]; lp++)
X  		lp->l_name[0] = lp->l_uid = lp->l_shipnum
X
X--- 169,175 -----
X  #endif
X  	my_uid = getuid();
X  	net = (float)s->file->points / s->specs->pts;
X! 	persons = getw(fp);					/*read file*/
X  	n = fread((char *)log, sizeof(struct logs), NLOG, fp);
X  	for (lp = &log[n]; lp < &log[NLOG]; lp++) 	/*clear tail of file*/
X  		lp->l_name[0] = lp->l_uid = lp->l_shipnum
X***************
X*** 167,173
X  	net = (float)s->file->points / s->specs->pts;
X  	persons = getw(fp);
X  	n = fread((char *)log, sizeof(struct logs), NLOG, fp);
X! 	for (lp = &log[n]; lp < &log[NLOG]; lp++)
X  		lp->l_name[0] = lp->l_uid = lp->l_shipnum
X  			= lp->l_gamenum = lp->l_netpoints = 0;
X  	rewind(fp);
X
X--- 171,177 -----
X  	net = (float)s->file->points / s->specs->pts;
X  	persons = getw(fp);					/*read file*/
X  	n = fread((char *)log, sizeof(struct logs), NLOG, fp);
X! 	for (lp = &log[n]; lp < &log[NLOG]; lp++) 	/*clear tail of file*/
X  		lp->l_name[0] = lp->l_uid = lp->l_shipnum
X  			= lp->l_gamenum = lp->l_netpoints = 0;
X  	rewind(fp);
X***************
X*** 171,177
X  		lp->l_name[0] = lp->l_uid = lp->l_shipnum
X  			= lp->l_gamenum = lp->l_netpoints = 0;
X  	rewind(fp);
X! 	if (persons < 0)
X  		(void) putw(1, fp);
X  	else
X  		(void) putw(persons + 1, fp);
X
X--- 175,181 -----
X  		lp->l_name[0] = lp->l_uid = lp->l_shipnum
X  			= lp->l_gamenum = lp->l_netpoints = 0;
X  	rewind(fp);
X! 	if (persons < 0)				/*incr # of players*/
X  		(void) putw(1, fp);
X  	else
X  		(void) putw(persons + 1, fp);
X***************
X*** 175,182
X  		(void) putw(1, fp);
X  	else
X  		(void) putw(persons + 1, fp);
X! 	for (lp = log; lp < &log[NLOG]; lp++)
X! 		if (net > (float)lp->l_netpoints
X  		    / scene[lp->l_gamenum].ship[lp->l_shipnum].specs->pts) {
X  			(void) fwrite((char *)log,
X  				sizeof (struct logs), lp - log, fp);
X
X--- 179,186 -----
X  		(void) putw(1, fp);
X  	else
X  		(void) putw(persons + 1, fp);
X! 	for (lp = log; lp < &log[NLOG]; lp++) {
X! 		if (net >= (float)lp->l_netpoints
X  		    / scene[lp->l_gamenum].ship[lp->l_shipnum].specs->pts) {
X  			/* write out scores higher than this one */
X  			(void) fwrite((char *)log,
X***************
X*** 178,183
X  	for (lp = log; lp < &log[NLOG]; lp++)
X  		if (net > (float)lp->l_netpoints
X  		    / scene[lp->l_gamenum].ship[lp->l_shipnum].specs->pts) {
X  			(void) fwrite((char *)log,
X  				sizeof (struct logs), lp - log, fp);
X  			(void) strcpy(log[NLOG-1].l_name, s->file->captain);
X
X--- 182,188 -----
X  	for (lp = log; lp < &log[NLOG]; lp++) {
X  		if (net >= (float)lp->l_netpoints
X  		    / scene[lp->l_gamenum].ship[lp->l_shipnum].specs->pts) {
X+ 			/* write out scores higher than this one */
X  			(void) fwrite((char *)log,
X  				sizeof (struct logs), lp - log, fp);
X  			/* create new entry for this score */
X***************
X*** 180,185
X  		    / scene[lp->l_gamenum].ship[lp->l_shipnum].specs->pts) {
X  			(void) fwrite((char *)log,
X  				sizeof (struct logs), lp - log, fp);
X  			(void) strcpy(log[NLOG-1].l_name, s->file->captain);
X  			log[NLOG-1].l_uid = getuid();
X  			log[NLOG-1].l_shipnum = s->file->index;
X
X--- 185,191 -----
X  			/* write out scores higher than this one */
X  			(void) fwrite((char *)log,
X  				sizeof (struct logs), lp - log, fp);
X+ 			/* create new entry for this score */
X  			(void) strcpy(log[NLOG-1].l_name, s->file->captain);
X  			log[NLOG-1].l_uid = getuid();
X  			log[NLOG-1].l_shipnum = s->file->index;
X***************
X*** 185,190
X  			log[NLOG-1].l_shipnum = s->file->index;
X  			log[NLOG-1].l_gamenum = game;
X  			log[NLOG-1].l_netpoints = s->file->points;
X  			(void) fwrite((char *)&log[NLOG-1],
X  				sizeof (struct logs), 1, fp);
X  			(void) fwrite((char *)lp,
X
X--- 191,197 -----
X  			log[NLOG-1].l_shipnum = s->file->index;
X  			log[NLOG-1].l_gamenum = game;
X  			log[NLOG-1].l_netpoints = s->file->points;
X+ 			/* write this new entry */
X  			(void) fwrite((char *)&log[NLOG-1],
X  				sizeof (struct logs), 1, fp);
X  			/* write scores lower than this */
X***************
X*** 187,194
X  			log[NLOG-1].l_netpoints = s->file->points;
X  			(void) fwrite((char *)&log[NLOG-1],
X  				sizeof (struct logs), 1, fp);
X! 			(void) fwrite((char *)lp,
X! 				sizeof (struct logs), &log[NLOG-1] - lp, fp);
X  			break;
X  		}
X  #ifdef LOCK_EX
X
X--- 194,208 -----
X  			/* write this new entry */
X  			(void) fwrite((char *)&log[NLOG-1],
X  				sizeof (struct logs), 1, fp);
X! 			/* write scores lower than this */
X! 		/*	(void) fwrite((char *)lp,
X! 		 *		sizeof (struct logs), &log[NLOG-1] - lp, fp);
X! 		 */
X! 			for (; lp < &log[NLOG-1]; lp++) { 
X! 				if (lp->l_uid != my_uid) /*purge my old score*/
X! 					fwrite( (char *)lp,
X! 					    sizeof(struct logs), 1, fp);
X! 				}
X  			break;
X  			}
X  		else if (lp->l_uid == my_uid) {	/* it's not my highest score*/
X***************
X*** 190,195
X  			(void) fwrite((char *)lp,
X  				sizeof (struct logs), &log[NLOG-1] - lp, fp);
X  			break;
X  		}
X  #ifdef LOCK_EX
X  	(void) flock(fileno(fp), LOCK_UN);
X
X--- 204,215 -----
X  					    sizeof(struct logs), 1, fp);
X  				}
X  			break;
X+ 			}
X+ 		else if (lp->l_uid == my_uid) {	/* it's not my highest score*/
X+ 			posit = 0;
X+ 			break;
X+ 			}
X+ 		else posit++;
X  		}
X  #ifdef LOCK_EX
X  	(void) flock(fileno(fp), LOCK_UN);
X***************
X*** 195,198
X  	(void) flock(fileno(fp), LOCK_UN);
X  #endif
X  	(void) fclose(fp);
X  }
X
X--- 215,219 -----
X  	(void) flock(fileno(fp), LOCK_UN);
X  #endif
X  	(void) fclose(fp);
X+ 	return(posit); /*post = 0 or (1 to NLOG) */ /* WOS */
X  }
SHAR_EOF
if test 7639 -ne "`wc -c 'diff.misc.c'`"
then
	echo shar: error transmitting "'diff.misc.c'" '(should have been 7639 characters)'
fi
echo shar: extracting "'diff.player1.c'" '(1390 characters)'
if test -f 'diff.player1.c'
then
	echo shar: over-writing existing file "'diff.player1.c'"
fi
sed 's/^X//' << \SHAR_EOF > 'diff.player1.c'
X*** sail/player1.c	Fri Feb  1 12:19:46 1985
X--- player1.c	Mon Apr  8 15:14:20 1985
X***************
X*** 1,5
X  #ifndef lint
X! static	char *sccsid = "@(#)player1.c	2.8 84/12/12";
X  #endif
X  
X  #include "player.h"
X
X--- 1,5 -----
X  #ifndef lint
X! static	char *sccsid = "@(#)player1.c	3.0 85/03/07";
X  #endif
X  
X  #include "player.h"
X***************
X*** 257,262
X  leave(conditions)
X  int conditions;
X  {
X  	(void) signal(SIGHUP, SIG_IGN);
X  	(void) signal(SIGINT, SIG_IGN);
X  	(void) signal(SIGQUIT, SIG_IGN);
X
X--- 257,264 -----
X  leave(conditions)
X  int conditions;
X  {
X+ 	int	posit = 0;
X+ 	char	logcmd[30];
X  	(void) signal(SIGHUP, SIG_IGN);
X  	(void) signal(SIGINT, SIG_IGN);
X  	(void) signal(SIGQUIT, SIG_IGN);
X***************
X*** 307,313
X  	}
X  
X  	if (ms != 0) {
X! 		log(ms);
X  		if (conditions != LEAVE_SYNC) {
X  			makesignal(ms, "Captain %s relinquishing.",
X  				(struct ship *)0, mf->captain);
X
X--- 309,315 -----
X  	}
X  
X  	if (ms != 0) {
X! 		posit = log(ms);
X  		if (conditions != LEAVE_SYNC) {
X  			makesignal(ms, "Captain %s relinquishing.",
X  				(struct ship *)0, mf->captain);
X***************
X*** 317,322
X  	}
X  	sync_close(!hasdriver);
X  	cleanupscreen();
X  	exit(0);
X  }
X  
X
X--- 319,329 -----
X  	}
X  	sync_close(!hasdriver);
X  	cleanupscreen();
X+ 	sleep(2);
X+ 	printf("\n\n\n");
X+ 	fflush(stdout);
X+ 	sprintf(logcmd,"sail.log -%d",posit);
X+ 	system(logcmd);
X  	exit(0);
X  }
X  
SHAR_EOF
if test 1390 -ne "`wc -c 'diff.player1.c'`"
then
	echo shar: error transmitting "'diff.player1.c'" '(should have been 1390 characters)'
fi
echo shar: extracting "'diff.player7.c'" '(2580 characters)'
if test -f 'diff.player7.c'
then
	echo shar: over-writing existing file "'diff.player7.c'"
fi
sed 's/^X//' << \SHAR_EOF > 'diff.player7.c'
X*** sail/player7.c	Fri Feb  1 12:20:07 1985
X--- player7.c	Mon Apr  8 15:14:26 1985
X***************
X*** 1,5
X  #ifndef lint
X! static	char *sccsid = "@(#)player7.c	2.8 84/02/23";
X  #endif
X  
X  #include "player.h"
X
X--- 1,5 -----
X  #ifndef lint
X! static	char *sccsid = "@(#)player7.c	3.0 85/03/07";
X  #endif
X  
X  #include "player.h"
X***************
X*** 107,113
X  	if (!done_curses)
X  		return;
X  	if (*fmt == '\7')
X! 		putchar(*fmt++);
X  	if (ship == 0)
X  		(void) wprintw(scroll_w, fmt, a, b, c, d);
X  	else
X
X--- 107,113 -----
X  	if (!done_curses)
X  		return;
X  	if (*fmt == '\7')
X! 		/*putchar(*fmt++);*/ fmt++; /*NO BELLS!*/
X  	if (ship == 0)
X  		(void) wprintw(scroll_w, fmt, a, b, c, d);
X  	else
X***************
X*** 250,256
X  	(void) wprintw(stat_w, "Fouls    %2d\n", fouled(ms));
X  	(void) wprintw(stat_w, "Grapples %2d\n", grappled(ms));
X  
X! 	(void) wmove(stat_w, STAT_2, 0);
X  	(void) wprintw(stat_w, "    0 %c(%c)\n",
X  		maxmove(ms, winddir + 3, -1) + '0',
X  		maxmove(ms, winddir + 3, 1) + '0');
X
X--- 250,256 -----
X  	(void) wprintw(stat_w, "Fouls    %2d\n", fouled(ms));
X  	(void) wprintw(stat_w, "Grapples %2d\n", grappled(ms));
X  
X! /*	(void) wmove(stat_w, STAT_2, 0);
X  	(void) wprintw(stat_w, "    0 %c(%c)\n",
X  		maxmove(ms, winddir + 3, -1) + '0',
X  		maxmove(ms, winddir + 3, 1) + '0');
X***************
X*** 265,270
X  	(void) wprintw(stat_w, "   %c(%c)\n",
X  		maxmove(ms, winddir, -1) + '0',
X  		maxmove(ms, winddir, 1) + '0');
X  
X  	(void) wmove(stat_w, STAT_3, 0);
X  	(void) wprintw(stat_w, "Load  %c%c %c%c\n",
X
X--- 265,297 -----
X  	(void) wprintw(stat_w, "   %c(%c)\n",
X  		maxmove(ms, winddir, -1) + '0',
X  		maxmove(ms, winddir, 1) + '0');
X+ */
X+ 	(void) wmove(stat_w, STAT_2, 0);
X+ 	(void) wprintw(stat_w, "   %c.%c\n",
X+ 		maxmove(ms, 1, -1) + '0',
X+ 		maxmove(ms, 1, 1) + '0');
X+ 	(void) wprintw(stat_w, "%c.%c | %c.%c\n",
X+ 		maxmove(ms, 8, -1) + '0',
X+ 		maxmove(ms, 8, 1) + '0',
X+ 		maxmove(ms, 2, -1) + '0',
X+ 		maxmove(ms, 2, 1) + '0');
X+ 	(void) waddstr(stat_w, "   \\|/\n");
X+ 	(void) wprintw(stat_w, "%c.%c-%d-%c.%c\n",
X+ 		maxmove(ms, 7, -1) + '0',
X+ 		maxmove(ms, 7, 1) + '0',
X+ 		windspeed,
X+ 		maxmove(ms, 3, -1) + '0',
X+ 		maxmove(ms, 3, 1) + '0');
X+ 	(void) waddstr(stat_w, "   /|\\\n");
X+ 	(void) wprintw(stat_w, "%c.%c | %c.%c\n",
X+ 		maxmove(ms, 6, -1) + '0',
X+ 		maxmove(ms, 6, 1) + '0',
X+ 		maxmove(ms, 4, -1) + '0',
X+ 		maxmove(ms, 4, 1) + '0');
X+ 	(void) wprintw(stat_w, "   %c.%c\n",
X+ 		maxmove(ms, 5, -1) + '0',
X+ 		maxmove(ms, 5, 1) + '0');
X+ 
X  
X  	(void) wmove(stat_w, STAT_3, 0);
X  	(void) wprintw(stat_w, "Load  %c%c %c%c\n",
SHAR_EOF
if test 2580 -ne "`wc -c 'diff.player7.c'`"
then
	echo shar: error transmitting "'diff.player7.c'" '(should have been 2580 characters)'
fi
echo shar: extracting "'diff.sail.6'" '(4125 characters)'
if test -f 'diff.sail.6'
then
	echo shar: over-writing existing file "'diff.sail.6'"
fi
sed 's/^X//' << \SHAR_EOF > 'diff.sail.6'
X*** sail/sail.6	Fri Feb  1 12:22:56 1985
X--- sail.6	Mon Apr  8 15:14:40 1985
X***************
X*** 1,4
X- .. @(#)sail.6	2.3 83/11/18
X  .TH SAIL PUBLIC 
X  .UC 4
X  .SH NAME
X
X--- 1,3 -----
X  .TH SAIL PUBLIC 
X  .UC 4
X  .SH NAME
X***************
X*** 149,155
X  of 1983.  Ed Wang rewrote and modularized the code (a monumental feat)
X  almost from scratch.  Although he introduced many new bugs, the final
X  result was very much cleaner and (?) faster.  He added window movement
X! commands and find ship commands.
X  .SH HISTORICAL INFO
X  Old Square Riggers were very maneuverable ships capable of intricate
X  sailing.  Their only disadvantage was an inability to sail very 
X
X--- 148,155 -----
X  of 1983.  Ed Wang rewrote and modularized the code (a monumental feat)
X  almost from scratch.  Although he introduced many new bugs, the final
X  result was very much cleaner and (?) faster.  He added window movement
X! commands and find ship commands. Minor changes, primarily the elimination
X! of all BELLS and changes in the wind-rose have been made by a later player.
X  .SH HISTORICAL INFO
X  Old Square Riggers were very maneuverable ships capable of intricate
X  sailing.  Their only disadvantage was an inability to sail very 
X***************
X*** 333,340
X  are no different.  A ship's ability to move depends on its attitide to the
X  wind.  The best angle possible is to have the wind off your quarter, that is,
X  just off the stern.  The direction rose on the side of the screen gives the
X! possible movements for your ship at all positions to the wind.  Battle
X! sail speeds are given first, and full sail speeds are given in parenthesis.
X  .nf
X  
X  				 0 1(2)
X
X--- 333,341 -----
X  are no different.  A ship's ability to move depends on its attitide to the
X  wind.  The best angle possible is to have the wind off your quarter, that is,
X  just off the stern.  The direction rose on the side of the screen gives the
X! possible movements for your ship at all positions to the wind. Battle 
X! sail speeds are given first, with full sail speeds following the decimal
X! point. Wind speed is given in the center of the rose.
X  .nf
X  			    0.0
X  			 1.2 | 1.2
X***************
X*** 336,341
X  possible movements for your ship at all positions to the wind.  Battle
X  sail speeds are given first, and full sail speeds are given in parenthesis.
X  .nf
X  
X  				 0 1(2)
X  				\\|/
X
X--- 337,349 -----
X  sail speeds are given first, with full sail speeds following the decimal
X  point. Wind speed is given in the center of the rose.
X  .nf
X+ 			    0.0
X+ 			 1.2 | 1.2
X+ 			    \\|/
X+ 			 3.6-5-3.6
X+ 			    /|\\
X+ 		      4.7 | 4.7
X+ 		  	    3.6  
X  
X  .fi
X  .SH WINDSPEED AND DIRECTION
X***************
X*** 337,349
X  sail speeds are given first, and full sail speeds are given in parenthesis.
X  .nf
X  
X- 				 0 1(2)
X- 				\\|/
X- 				-^-3(6)
X- 				/|\\
X- 				 | 4(7)
X- 				3(6)  
X- 
X  .fi
X  Pretend the bow of your ship (the "^") is pointing upward and the wind is
X  blowing from the bottom to the top of the page.  The
X
X--- 345,350 -----
X  		      4.7 | 4.7
X  		  	    3.6  
X  
X  .fi
X  .SH WINDSPEED AND DIRECTION
X  The windspeed and direction is displayed as a little weather vane on the
X***************
X*** 345,357
X  				3(6)  
X  
X  .fi
X- Pretend the bow of your ship (the "^") is pointing upward and the wind is
X- blowing from the bottom to the top of the page.  The
X- numbers at the bottom "3(6)" will be your speed under battle or full
X- sails in such a situation.  If the wind is off your quarter, then you
X- can move "4(7)".  If the wind is off your beam, "3(6)".  If the wind is
X- off your bow, then you can only move "1(2)".  Facing into the wind, you
X- can't move at all.  Ships facing into the wind were said to be "in irons".
X  .SH WINDSPEED AND DIRECTION
X  The windspeed and direction is displayed as a little weather vane on the
X  side of the screen.  The number in the middle of the vane indicates the wind
X
X--- 346,351 -----
X  		  	    3.6  
X  
X  .fi
X  .SH WINDSPEED AND DIRECTION
X  The windspeed and direction is displayed as a little weather vane on the
X  side of the screen.  The number in the middle of the vane indicates the wind
SHAR_EOF
if test 4125 -ne "`wc -c 'diff.sail.6'`"
then
	echo shar: error transmitting "'diff.sail.6'" '(should have been 4125 characters)'
fi
echo shar: extracting "'diff.sail.log.c'" '(6571 characters)'
if test -f 'diff.sail.log.c'
then
	echo shar: over-writing existing file "'diff.sail.log.c'"
fi
sed 's/^X//' << \SHAR_EOF > 'diff.sail.log.c'
X*** sail/sail.log.c	Fri Feb  1 14:18:27 1985
X--- sail.log.c	Mon Apr  8 15:14:44 1985
X***************
X*** 1,5
X  #ifndef lint
X! static	char *sccsid = "@(#)sail.log.c	2.1 83/10/31";
X  #endif
X  
X  /*
X
X--- 1,5 -----
X  #ifndef lint
X! 		char *sccsid = "@(#)sail.log.c	3.0 85/03/07";
X  #endif
X  
X  /*
X***************
X*** 9,14
X   *
X   *  -s force a short listing (without real usernames)
X   *  -l force a long listing (print out real usernames)
X   */
X  #include <pwd.h>
X  #include "externs.h"
X
X--- 9,15 -----
X   *
X   *  -s force a short listing (without real usernames)
X   *  -l force a long listing (print out real usernames)
X+  *  -n (put line n in standout mode, for player.c only) 
X   */
X  #include <pwd.h>
X  #include "externs.h"
X***************
X*** 12,17
X   */
X  #include <pwd.h>
X  #include "externs.h"
X  
X  char *title[] = {
X  	"Admiral", "Commodore", "Captain", "Captain",
X
X--- 13,19 -----
X   */
X  #include <pwd.h>
X  #include "externs.h"
X+ #include <curses.h>
X  
X  char *title[] = {
X  	"Admiral ", "Commodore ", "Captain ", "Captain ",
X***************
X*** 14,22
X  #include "externs.h"
X  
X  char *title[] = {
X! 	"Admiral", "Commodore", "Captain", "Captain",
X! 	"Captain", "Captain", "Captain", "Commander",
X! 	"Commander", "Lieutenant"
X  };
X  
X  main(argc, argv)
X
X--- 16,24 -----
X  #include <curses.h>
X  
X  char *title[] = {
X! 	"Admiral ", "Commodore ", "Captain ", "Captain ",
X! 	"Captain ", "Captain ", "Captain ", "Commander ",
X! 	"Commander ", "Lieutenant "
X  };
X  
X  char punish[] = {
X***************
X*** 19,24
X  	"Commander", "Lieutenant"
X  };
X  
X  main(argc, argv)
X  int argc;
X  char **argv;
X
X--- 21,30 -----
X  	"Commander ", "Lieutenant "
X  };
X  
X+ char punish[] = {
X+ 	"keelhauled: Mister "
X+ };
X+ 
X  main(argc, argv)
X  int argc;
X  char **argv;
X***************
X*** 23,28
X  int argc;
X  char **argv;
X  {
X  	FILE *fp;
X  	char sbuf[32];
X  	int n = 0, people;
X
X--- 29,38 -----
X  int argc;
X  char **argv;
X  {
X+ 	int	putachar();
X+ 	char	buffer[1024];
X+ 	char	buflin[32];
X+ 	char	*p;	
X  	FILE *fp;
X  	char sbuf[40];
X  	int n = 0, people;
X***************
X*** 24,30
X  char **argv;
X  {
X  	FILE *fp;
X! 	char sbuf[32];
X  	int n = 0, people;
X  	int usrnam = 0;
X  	struct passwd *getpwuid(), *pass;
X
X--- 34,40 -----
X  	char	buflin[32];
X  	char	*p;	
X  	FILE *fp;
X! 	char sbuf[40];
X  	int n = 0, people;
X  	int posit = 0;
X  	int ct = 0;
X***************
X*** 26,31
X  	FILE *fp;
X  	char sbuf[32];
X  	int n = 0, people;
X  	int usrnam = 0;
X  	struct passwd *getpwuid(), *pass;
X  	struct logs log;
X
X--- 36,43 -----
X  	FILE *fp;
X  	char sbuf[40];
X  	int n = 0, people;
X+ 	int posit = 0;
X+ 	int ct = 0;
X  	int usrnam = 0;
X  	struct passwd *getpwuid(), *pass;
X  	struct logs log;
X***************
X*** 31,36
X  	struct logs log;
X  	struct ship *ship;
X  
X  	if (argc > 1 && argc == 2)
X  		if (strcmp(argv[1], "-s") == 0)
X  			usrnam = 0;
X
X--- 43,49 -----
X  	struct logs log;
X  	struct ship *ship;
X  
X+ 	tgetent(buffer,getenv("TERM"));
X  	if (argc > 1 && argc == 2)
X  		if (strcmp(argv[1], "-s") == 0)
X  			usrnam = 0;
X***************
X*** 36,41
X  			usrnam = 0;
X  		else if (strcmp(argv[1], "-l") == 0)
X  			usrnam = 1;
X  		else {
X  			fprintf(stderr, "usage: %s: [-s/l]\n", argv[0]);
X  			exit(1);
X
X--- 49,56 -----
X  			usrnam = 0;
X  		else if (strcmp(argv[1], "-l") == 0)
X  			usrnam = 1;
X+ 		else if (argv[1][0] == '-' )
X+ 			posit = atoi(&argv[1][1]) ;
X  		else {
X  			fprintf(stderr, "usage: %s: [-s/l]\n", argv[0]);
X  			exit(1);
X***************
X*** 54,59
X  		perror(LOGFILE);
X  		exit(1);
X  	}
X  	while (fread((char *)&log, sizeof log, 1, fp) == 1
X  	       && log.l_name[0] != '\0') {
X  		if (usrnam && (pass = getpwuid(log.l_uid)) != NULL)
X
X--- 69,75 -----
X  		perror(LOGFILE);
X  		exit(1);
X  	}
X+ 	printf("+----------------------+++***@@@[   SAIL HO!   ]@@@***+++---------------------+\n");
X  	while (fread((char *)&log, sizeof log, 1, fp) == 1
X  	       && log.l_name[0] != '\0') {
X  		if (++ct == posit) {
X***************
X*** 56,66
X  	}
X  	while (fread((char *)&log, sizeof log, 1, fp) == 1
X  	       && log.l_name[0] != '\0') {
X! 		if (usrnam && (pass = getpwuid(log.l_uid)) != NULL)
X! 			(void) sprintf(sbuf, "%10.10s (%s)",
X! 				log.l_name, pass->pw_name);
X! 		else
X! 			(void) sprintf(sbuf, "%20.20s", log.l_name);
X  		ship = &scene[log.l_gamenum].ship[log.l_shipnum];
X  		printf("%-10s %21s of the %15s %3d points, %5.2f equiv\n",
X  			title[n++], sbuf, ship->shipname, log.l_netpoints,
X
X--- 72,90 -----
X  	printf("+----------------------+++***@@@[   SAIL HO!   ]@@@***+++---------------------+\n");
X  	while (fread((char *)&log, sizeof log, 1, fp) == 1
X  	       && log.l_name[0] != '\0') {
X! 		if (++ct == posit) {
X! 			p = buflin;	
X! 			tgetstr("so",&p);
X! 			tputs(buflin,0,putachar);
X! 			}	
X! 		if (log.l_netpoints == 0) strcpy(sbuf,punish);
X! 		else strcpy(sbuf,title[n++]);
X! 		if (usrnam && (pass = getpwuid(log.l_uid)) != NULL) {
X! 			strcat(sbuf,"(");
X! 			strcat(sbuf,pass->pw_name);
X! 			strcat(sbuf,")");
X! 			}
X! 		strcat(sbuf,log.l_name);
X  		ship = &scene[log.l_gamenum].ship[log.l_shipnum];
X  		printf("%-32s of the %15s %3d points, %5.2f equiv\n",
X  			sbuf, ship->shipname, log.l_netpoints,
X***************
X*** 62,69
X  		else
X  			(void) sprintf(sbuf, "%20.20s", log.l_name);
X  		ship = &scene[log.l_gamenum].ship[log.l_shipnum];
X! 		printf("%-10s %21s of the %15s %3d points, %5.2f equiv\n",
X! 			title[n++], sbuf, ship->shipname, log.l_netpoints,
X  			(float) log.l_netpoints / ship->specs->pts);
X  	}
X  	printf("\n%d people have played.\n", people);
X
X--- 86,93 -----
X  			}
X  		strcat(sbuf,log.l_name);
X  		ship = &scene[log.l_gamenum].ship[log.l_shipnum];
X! 		printf("%-32s of the %15s %3d points, %5.2f equiv\n",
X! 			sbuf, ship->shipname, log.l_netpoints,
X  			(float) log.l_netpoints / ship->specs->pts);
X  
X  		if (ct == posit) {
X***************
X*** 65,70
X  		printf("%-10s %21s of the %15s %3d points, %5.2f equiv\n",
X  			title[n++], sbuf, ship->shipname, log.l_netpoints,
X  			(float) log.l_netpoints / ship->specs->pts);
X  	}
X  	printf("\n%d people have played.\n", people);
X  }
X
X--- 89,100 -----
X  		printf("%-32s of the %15s %3d points, %5.2f equiv\n",
X  			sbuf, ship->shipname, log.l_netpoints,
X  			(float) log.l_netpoints / ship->specs->pts);
X+ 
X+ 		if (ct == posit) {
X+ 			p = buflin;	
X+ 			tgetstr("se",&p);
X+ 			tputs(buflin,0,putachar);
X+ 			}			
X  	}
X  	printf("\n%d people have played.\n", people);
X  }
X***************
X*** 68,70
X  	}
X  	printf("\n%d people have played.\n", people);
X  }
X
X--- 98,107 -----
X  	}
X  	printf("\n%d people have played.\n", people);
X  }
X+ 
X+ putachar(c)
X+ char	c;
X+ 	{
X+ 	putchar(c);
X+ 	fflush(stdout);
X+ 	}
SHAR_EOF
if test 6571 -ne "`wc -c 'diff.sail.log.c'`"
then
	echo shar: error transmitting "'diff.sail.log.c'" '(should have been 6571 characters)'
fi
echo shar: extracting "'diff.version.c'" '(262 characters)'
if test -f 'diff.version.c'
then
	echo shar: over-writing existing file "'diff.version.c'"
fi
sed 's/^X//' << \SHAR_EOF > 'diff.version.c'
X*** sail/version.c	Fri Feb  1 14:18:33 1985
X--- version.c	Mon Apr  8 15:14:47 1985
X***************
X*** 1
X! char version[] = "Wooden Ships and Iron Men, Version 2.4 (84/02/23)";
X
X--- 1 -----
X! char version[] = "Wooden Ships and Iron Men, Version 3.0 (85/03/07)";
SHAR_EOF
if test 262 -ne "`wc -c 'diff.version.c'`"
then
	echo shar: error transmitting "'diff.version.c'" '(should have been 262 characters)'
fi
#	End of shell archive
exit 0
-- 
Bill Swan {ihnp4|decvax|..}!uw-beaver!tikal!persci!bill