summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--atc/Makefile4
-rw-r--r--atc/atc.613
-rw-r--r--atc/def.h9
-rw-r--r--atc/extern.c13
-rw-r--r--atc/extern.h9
-rw-r--r--atc/grammar.y13
-rw-r--r--atc/graphics.c13
-rw-r--r--atc/include.h9
-rw-r--r--atc/input.c13
-rw-r--r--atc/lex.l13
-rw-r--r--atc/list.c13
-rw-r--r--atc/log.c13
-rw-r--r--atc/main.c19
-rw-r--r--atc/pathnames.h9
-rw-r--r--atc/struct.h9
-rw-r--r--atc/tunable.c13
-rw-r--r--atc/tunable.h9
-rw-r--r--atc/update.c13
-rw-r--r--backgammon/Makefile4
-rw-r--r--backgammon/backgammon/Makefile4
-rw-r--r--backgammon/backgammon/backgammon.611
-rw-r--r--backgammon/backgammon/extra.c13
-rw-r--r--backgammon/backgammon/main.c6
-rw-r--r--backgammon/backgammon/move.c13
-rw-r--r--backgammon/backgammon/text.c13
-rw-r--r--backgammon/backgammon/version.c13
-rw-r--r--backgammon/common_source/allow.c13
-rw-r--r--backgammon/common_source/back.h9
-rw-r--r--backgammon/common_source/backgammon.c13
-rw-r--r--backgammon/common_source/board.c13
-rw-r--r--backgammon/common_source/check.c13
-rw-r--r--backgammon/common_source/fancy.c13
-rw-r--r--backgammon/common_source/init.c13
-rw-r--r--backgammon/common_source/odds.c13
-rw-r--r--backgammon/common_source/one.c13
-rw-r--r--backgammon/common_source/save.c13
-rw-r--r--backgammon/common_source/subs.c13
-rw-r--r--backgammon/common_source/table.c13
-rw-r--r--backgammon/teachgammon/Makefile4
-rw-r--r--backgammon/teachgammon/data.c13
-rw-r--r--backgammon/teachgammon/teach.c19
-rw-r--r--backgammon/teachgammon/ttext1.c13
-rw-r--r--backgammon/teachgammon/ttext2.c13
-rw-r--r--backgammon/teachgammon/tutor.c13
-rw-r--r--backgammon/teachgammon/tutor.h9
-rw-r--r--battlestar/Makefile4
-rw-r--r--battlestar/battlestar.611
-rw-r--r--battlestar/battlestar.c19
-rw-r--r--battlestar/com1.c13
-rw-r--r--battlestar/com2.c13
-rw-r--r--battlestar/com3.c13
-rw-r--r--battlestar/com4.c13
-rw-r--r--battlestar/com5.c13
-rw-r--r--battlestar/com6.c13
-rw-r--r--battlestar/com7.c13
-rw-r--r--battlestar/cypher.c13
-rw-r--r--battlestar/dayfile.c13
-rw-r--r--battlestar/dayobjs.c13
-rw-r--r--battlestar/externs.h9
-rw-r--r--battlestar/fly.c14
-rw-r--r--battlestar/getcom.c13
-rw-r--r--battlestar/globals.c13
-rw-r--r--battlestar/init.c13
-rw-r--r--battlestar/misc.c13
-rw-r--r--battlestar/nightfile.c13
-rw-r--r--battlestar/nightobjs.c13
-rw-r--r--battlestar/parse.c13
-rw-r--r--battlestar/pathnames.h9
-rw-r--r--battlestar/room.c13
-rw-r--r--battlestar/save.c13
-rw-r--r--battlestar/words.c13
-rw-r--r--bcd/Makefile4
-rw-r--r--bcd/bcd.637
-rw-r--r--bcd/bcd.c31
-rw-r--r--caesar/Makefile8
-rw-r--r--caesar/caesar.620
-rw-r--r--caesar/caesar.c19
-rw-r--r--caesar/rot13.sh1
-rw-r--r--canfield/Makefile4
-rw-r--r--canfield/canfield/Makefile4
-rw-r--r--canfield/canfield/canfield.611
-rw-r--r--canfield/canfield/canfield.c24
-rw-r--r--canfield/canfield/pathnames.h9
-rw-r--r--canfield/cfscores/Makefile4
-rw-r--r--canfield/cfscores/cfscores.c19
-rw-r--r--cribbage/Makefile4
-rw-r--r--cribbage/cards.c159
-rw-r--r--cribbage/crib.c722
-rw-r--r--cribbage/cribbage.611
-rw-r--r--cribbage/cribbage.h60
-rw-r--r--cribbage/cribcur.h9
-rw-r--r--cribbage/deck.h9
-rw-r--r--cribbage/extern.c22
-rw-r--r--cribbage/instr.c23
-rw-r--r--cribbage/io.c763
-rw-r--r--cribbage/pathnames.h11
-rw-r--r--cribbage/score.c400
-rw-r--r--cribbage/support.c376
-rw-r--r--dm/Makefile5
-rw-r--r--dm/dm.811
-rw-r--r--dm/dm.c40
-rw-r--r--dm/dm.conf.511
-rw-r--r--dm/pathnames.h9
103 files changed, 2068 insertions, 1618 deletions
diff --git a/atc/Makefile b/atc/Makefile
index 22ade6bc..8bf902a6 100644
--- a/atc/Makefile
+++ b/atc/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.7 (Berkeley) 6/27/90
-# $Id: Makefile,v 1.8 1994/12/25 12:38:41 pk Exp $
+# $NetBSD: Makefile,v 1.9 1995/03/21 15:03:38 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= atc
CFLAGS+=-DBSD -I${.CURDIR} -I.
diff --git a/atc/atc.6 b/atc/atc.6
index 9c1a21b1..b7e32d69 100644
--- a/atc/atc.6
+++ b/atc/atc.6
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1990 The Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: atc.6,v 1.3 1995/03/21 15:03:43 cgd Exp $
+.\"
+.\" Copyright (c) 1990, 1993
+.\" The Regents of the University of California. All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" Ed James.
@@ -32,8 +34,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)atc.6 5.4 (Berkeley) 6/23/90
-.\" $Id: atc.6,v 1.2 1993/08/01 07:47:39 mycroft Exp $
+.\" @(#)atc.6 8.1 (Berkeley) 5/31/93
.\"
. \" XP - exdented paragraph
.de XP
@@ -46,10 +47,10 @@
..
.\" Copyright (c) 1986 Ed James. All rights reserved.
.\"
-.TH ATC 6 "June 23, 1990"
+.TH ATC 6 "May 31, 1993"
.UC
.SH NAME
-atc \- Air Traffic Controller Game
+atc \- air traffic controller game
.SH SYNOPSIS
.B atc
-[u?lstp] [-[gf] game_name] [-r random seed]
diff --git a/atc/def.h b/atc/def.h
index eb3dae10..1290a30e 100644
--- a/atc/def.h
+++ b/atc/def.h
@@ -1,6 +1,8 @@
+/* $NetBSD: def.h,v 1.3 1995/03/21 15:03:47 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ed James.
@@ -33,8 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)def.h 5.2 (Berkeley) 4/30/90
- * $Id: def.h,v 1.2 1993/08/01 18:57:17 mycroft Exp $
+ * @(#)def.h 8.1 (Berkeley) 5/31/93
*/
/*
diff --git a/atc/extern.c b/atc/extern.c
index 2d89f58c..2f9a2128 100644
--- a/atc/extern.c
+++ b/atc/extern.c
@@ -1,6 +1,8 @@
+/* $NetBSD: extern.c,v 1.3 1995/03/21 15:03:50 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ed James.
@@ -44,8 +46,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)extern.c 5.4 (Berkeley) 10/30/90";*/
-static char rcsid[] = "$Id: extern.c,v 1.2 1993/08/01 18:57:11 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)extern.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: extern.c,v 1.3 1995/03/21 15:03:50 cgd Exp $";
+#endif
#endif /* not lint */
#include "include.h"
diff --git a/atc/extern.h b/atc/extern.h
index 5d5f632c..fac22924 100644
--- a/atc/extern.h
+++ b/atc/extern.h
@@ -1,6 +1,8 @@
+/* $NetBSD: extern.h,v 1.3 1995/03/21 15:03:54 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ed James.
@@ -33,8 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)extern.h 5.4 (Berkeley) 10/30/90
- * $Id: extern.h,v 1.2 1993/08/01 18:57:16 mycroft Exp $
+ * @(#)extern.h 8.1 (Berkeley) 5/31/93
*/
/*
diff --git a/atc/grammar.y b/atc/grammar.y
index d4a31d33..a409b490 100644
--- a/atc/grammar.y
+++ b/atc/grammar.y
@@ -1,6 +1,8 @@
+/* $NetBSD: grammar.y,v 1.3 1995/03/21 15:03:59 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ed James.
@@ -62,8 +64,11 @@
#include "include.h"
#ifndef lint
-/*static char sccsid[] = "from: @(#)grammar.y 5.2 (Berkeley) 4/30/90";*/
-static char rcsid[] = "$Id: grammar.y,v 1.2 1993/08/01 18:57:12 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)grammar.y 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: grammar.y,v 1.3 1995/03/21 15:03:59 cgd Exp $";
+#endif
#endif /* not lint */
int errors = 0;
diff --git a/atc/graphics.c b/atc/graphics.c
index 6565e85c..75df3925 100644
--- a/atc/graphics.c
+++ b/atc/graphics.c
@@ -1,6 +1,8 @@
+/* $NetBSD: graphics.c,v 1.3 1995/03/21 15:04:04 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ed James.
@@ -44,8 +46,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)graphics.c 5.3 (Berkeley) 10/30/90";*/
-static char rcsid[] = "$Id: graphics.c,v 1.2 1993/08/01 18:57:09 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)graphics.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: graphics.c,v 1.3 1995/03/21 15:04:04 cgd Exp $";
+#endif
#endif /* not lint */
#include "include.h"
diff --git a/atc/include.h b/atc/include.h
index a8cbfb18..2e8865a7 100644
--- a/atc/include.h
+++ b/atc/include.h
@@ -1,6 +1,8 @@
+/* $NetBSD: include.h,v 1.3 1995/03/21 15:04:08 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ed James.
@@ -33,8 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)include.h 5.3 (Berkeley) 4/30/90
- * $Id: include.h,v 1.2 1993/08/01 18:57:16 mycroft Exp $
+ * @(#)include.h 8.1 (Berkeley) 5/31/93
*/
/*
diff --git a/atc/input.c b/atc/input.c
index f4a9ee07..fa2d58e9 100644
--- a/atc/input.c
+++ b/atc/input.c
@@ -1,6 +1,8 @@
+/* $NetBSD: input.c,v 1.3 1995/03/21 15:04:12 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ed James.
@@ -44,8 +46,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)input.c 5.4 (Berkeley) 4/30/90";*/
-static char rcsid[] = "$Id: input.c,v 1.2 1993/08/01 18:57:08 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)input.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: input.c,v 1.3 1995/03/21 15:04:12 cgd Exp $";
+#endif
#endif not lint
#include "include.h"
diff --git a/atc/lex.l b/atc/lex.l
index 325b3e68..54f84c46 100644
--- a/atc/lex.l
+++ b/atc/lex.l
@@ -1,7 +1,9 @@
%{
+/* $NetBSD: lex.l,v 1.3 1995/03/21 15:04:15 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ed James.
@@ -45,8 +47,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)lex.l 5.2 (Berkeley) 4/30/90";*/
-static char rcsid[] = "$Id: lex.l,v 1.2 1993/08/01 18:57:07 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)lex.l 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: lex.l,v 1.3 1995/03/21 15:04:15 cgd Exp $";
+#endif
#endif /* not lint */
#include "y.tab.h"
diff --git a/atc/list.c b/atc/list.c
index 8827bade..62132cb9 100644
--- a/atc/list.c
+++ b/atc/list.c
@@ -1,6 +1,8 @@
+/* $NetBSD: list.c,v 1.3 1995/03/21 15:04:18 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ed James.
@@ -44,8 +46,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)list.c 5.2 (Berkeley) 4/30/90";*/
-static char rcsid[] = "$Id: list.c,v 1.2 1993/08/01 18:57:05 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)list.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: list.c,v 1.3 1995/03/21 15:04:18 cgd Exp $";
+#endif
#endif /* not lint */
#include "include.h"
diff --git a/atc/log.c b/atc/log.c
index e9ea4309..76e878d8 100644
--- a/atc/log.c
+++ b/atc/log.c
@@ -1,6 +1,8 @@
+/* $NetBSD: log.c,v 1.3 1995/03/21 15:04:21 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ed James.
@@ -44,8 +46,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)log.c 5.7 (Berkeley) 10/30/90";*/
-static char rcsid[] = "$Id: log.c,v 1.2 1993/08/01 18:57:06 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)log.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: log.c,v 1.3 1995/03/21 15:04:21 cgd Exp $";
+#endif
#endif not lint
#include "include.h"
diff --git a/atc/main.c b/atc/main.c
index 0910da90..a75a43f2 100644
--- a/atc/main.c
+++ b/atc/main.c
@@ -1,6 +1,8 @@
+/* $NetBSD: main.c,v 1.3 1995/03/21 15:04:24 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ed James.
@@ -44,14 +46,17 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1990 The Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1990, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)main.c 5.4 (Berkeley) 3/5/91";*/
-static char rcsid[] = "$Id: main.c,v 1.2 1993/08/01 18:57:04 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: main.c,v 1.3 1995/03/21 15:04:24 cgd Exp $";
+#endif
#endif /* not lint */
#include "include.h"
diff --git a/atc/pathnames.h b/atc/pathnames.h
index 796e5c78..c6f65339 100644
--- a/atc/pathnames.h
+++ b/atc/pathnames.h
@@ -1,6 +1,8 @@
+/* $NetBSD: pathnames.h,v 1.3 1995/03/21 15:04:28 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,8 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)pathnames.h 5.4 (Berkeley) 4/30/90
- * $Id: pathnames.h,v 1.2 1993/08/01 18:57:15 mycroft Exp $
+ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93
*/
#include <paths.h>
diff --git a/atc/struct.h b/atc/struct.h
index 2cde703c..016f1d6c 100644
--- a/atc/struct.h
+++ b/atc/struct.h
@@ -1,6 +1,8 @@
+/* $NetBSD: struct.h,v 1.3 1995/03/21 15:04:31 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ed James.
@@ -33,8 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)struct.h 5.2 (Berkeley) 4/30/90
- * $Id: struct.h,v 1.2 1993/08/01 18:57:14 mycroft Exp $
+ * @(#)struct.h 8.1 (Berkeley) 5/31/93
*/
/*
diff --git a/atc/tunable.c b/atc/tunable.c
index d2eb3e2d..b864e70d 100644
--- a/atc/tunable.c
+++ b/atc/tunable.c
@@ -1,6 +1,8 @@
+/* $NetBSD: tunable.c,v 1.3 1995/03/21 15:04:33 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ed James.
@@ -44,8 +46,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)tunable.c 5.4 (Berkeley) 4/30/90";*/
-static char rcsid[] = "$Id: tunable.c,v 1.2 1993/08/01 18:57:03 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)tunable.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: tunable.c,v 1.3 1995/03/21 15:04:33 cgd Exp $";
+#endif
#endif /* not lint */
/*
diff --git a/atc/tunable.h b/atc/tunable.h
index 44e43855..a295a477 100644
--- a/atc/tunable.h
+++ b/atc/tunable.h
@@ -1,6 +1,8 @@
+/* $NetBSD: tunable.h,v 1.3 1995/03/21 15:04:35 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ed James.
@@ -33,8 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)tunable.h 5.3 (Berkeley) 4/30/90
- * $Id: tunable.h,v 1.2 1993/08/01 18:57:13 mycroft Exp $
+ * @(#)tunable.h 8.1 (Berkeley) 5/31/93
*/
/*
diff --git a/atc/update.c b/atc/update.c
index b5feab5f..cc2f85c5 100644
--- a/atc/update.c
+++ b/atc/update.c
@@ -1,6 +1,8 @@
+/* $NetBSD: update.c,v 1.3 1995/03/21 15:04:37 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Ed James.
@@ -44,8 +46,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)update.c 5.5 (Berkeley) 10/30/90";*/
-static char rcsid[] = "$Id: update.c,v 1.2 1993/08/01 18:57:02 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)update.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: update.c,v 1.3 1995/03/21 15:04:37 cgd Exp $";
+#endif
#endif not lint
#include "include.h"
diff --git a/backgammon/Makefile b/backgammon/Makefile
index ccdd8c19..69476e18 100644
--- a/backgammon/Makefile
+++ b/backgammon/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.1 (Berkeley) 6/17/90
-# $Id: Makefile,v 1.2 1993/08/01 05:46:17 mycroft Exp $
+# $NetBSD: Makefile,v 1.3 1995/03/21 15:04:47 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
SUBDIR= backgammon teachgammon
diff --git a/backgammon/backgammon/Makefile b/backgammon/backgammon/Makefile
index dac0323b..47367b33 100644
--- a/backgammon/backgammon/Makefile
+++ b/backgammon/backgammon/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.16 (Berkeley) 5/11/90
-# $Id: Makefile,v 1.5 1994/12/22 09:32:52 cgd Exp $
+# $NetBSD: Makefile,v 1.6 1995/03/21 15:04:52 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= backgammon
CFLAGS+=-DV7 -I${.CURDIR}/../common_source
diff --git a/backgammon/backgammon/backgammon.6 b/backgammon/backgammon/backgammon.6
index 4b4b3641..c1b439c6 100644
--- a/backgammon/backgammon/backgammon.6
+++ b/backgammon/backgammon/backgammon.6
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: backgammon.6,v 1.4 1995/03/21 15:04:55 cgd Exp $
+.\"
+.\" Copyright (c) 1980, 1993
+.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -29,10 +31,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)backgammon.6 6.6 (Berkeley) 8/3/91
-.\" $Id: backgammon.6,v 1.3 1993/08/05 04:16:58 jtc Exp $
+.\" @(#)backgammon.6 8.1 (Berkeley) 5/31/93
.\"
-.Dd August 3, 1991
+.Dd May 31, 1993
.Dt BACKGAMMON 6
.Os
.Sh NAME
diff --git a/backgammon/backgammon/extra.c b/backgammon/backgammon/extra.c
index b9507a3e..034c959f 100644
--- a/backgammon/backgammon/extra.c
+++ b/backgammon/backgammon/extra.c
@@ -1,6 +1,8 @@
+/* $NetBSD: extra.c,v 1.3 1995/03/21 15:05:01 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)extra.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: extra.c,v 1.2 1993/08/01 18:56:54 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)extra.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: extra.c,v 1.3 1995/03/21 15:05:01 cgd Exp $";
+#endif
#endif /* not lint */
#include "back.h"
diff --git a/backgammon/backgammon/main.c b/backgammon/backgammon/main.c
index 0102a92c..44cf07bb 100644
--- a/backgammon/backgammon/main.c
+++ b/backgammon/backgammon/main.c
@@ -1,3 +1,5 @@
+/* $NetBSD: main.c,v 1.2 1995/03/21 15:05:06 cgd Exp $ */
+
/*
* Copyright (c) 1980, 1993
* The Regents of the University of California. All rights reserved.
@@ -38,7 +40,11 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
+#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: main.c,v 1.2 1995/03/21 15:05:06 cgd Exp $";
+#endif
#endif /* not lint */
#include <stdio.h>
diff --git a/backgammon/backgammon/move.c b/backgammon/backgammon/move.c
index e0f1521c..1f437feb 100644
--- a/backgammon/backgammon/move.c
+++ b/backgammon/backgammon/move.c
@@ -1,6 +1,8 @@
+/* $NetBSD: move.c,v 1.4 1995/03/21 15:05:10 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)move.c 5.6 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: move.c,v 1.3 1993/12/03 09:32:55 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: move.c,v 1.4 1995/03/21 15:05:10 cgd Exp $";
+#endif
#endif /* not lint */
#include "back.h"
diff --git a/backgammon/backgammon/text.c b/backgammon/backgammon/text.c
index 3f55ae24..8dbe621d 100644
--- a/backgammon/backgammon/text.c
+++ b/backgammon/backgammon/text.c
@@ -1,6 +1,8 @@
+/* $NetBSD: text.c,v 1.3 1995/03/21 15:05:13 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)text.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: text.c,v 1.2 1993/08/01 18:56:53 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)text.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: text.c,v 1.3 1995/03/21 15:05:13 cgd Exp $";
+#endif
#endif /* not lint */
#include "back.h"
diff --git a/backgammon/backgammon/version.c b/backgammon/backgammon/version.c
index 6b4dd35d..504c5960 100644
--- a/backgammon/backgammon/version.c
+++ b/backgammon/backgammon/version.c
@@ -1,6 +1,8 @@
+/* $NetBSD: version.c,v 1.3 1995/03/21 15:05:16 cgd Exp $ */
+
/*
- * Copyright (c) 1980, 1987 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1987, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)version.c 1.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: version.c,v 1.2 1993/08/01 18:56:52 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)version.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: version.c,v 1.3 1995/03/21 15:05:16 cgd Exp $";
+#endif
#endif /* not lint */
char *message[] = {
diff --git a/backgammon/common_source/allow.c b/backgammon/common_source/allow.c
index 7744f474..b445be42 100644
--- a/backgammon/common_source/allow.c
+++ b/backgammon/common_source/allow.c
@@ -1,6 +1,8 @@
+/* $NetBSD: allow.c,v 1.3 1995/03/21 15:05:24 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)allow.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: allow.c,v 1.2 1993/08/01 18:56:46 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)allow.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: allow.c,v 1.3 1995/03/21 15:05:24 cgd Exp $";
+#endif
#endif /* not lint */
#include "back.h"
diff --git a/backgammon/common_source/back.h b/backgammon/common_source/back.h
index 2d5e091c..0e556c41 100644
--- a/backgammon/common_source/back.h
+++ b/backgammon/common_source/back.h
@@ -1,6 +1,8 @@
+/* $NetBSD: back.h,v 1.3 1995/03/21 15:05:28 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,8 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)back.h 5.4 (Berkeley) 6/1/90
- * $Id: back.h,v 1.2 1993/08/01 18:56:48 mycroft Exp $
+ * @(#)back.h 8.1 (Berkeley) 5/31/93
*/
#include <sgtty.h>
diff --git a/backgammon/common_source/backgammon.c b/backgammon/common_source/backgammon.c
index 24ec4d4e..97b8f19b 100644
--- a/backgammon/common_source/backgammon.c
+++ b/backgammon/common_source/backgammon.c
@@ -1,6 +1,8 @@
+/* $NetBSD: backgammon.c,v 1.3 1995/03/21 15:05:31 cgd Exp $ */
+
/*-
- * Copyright (c) 1991 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1991, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)backgammon.c 5.1 (Berkeley) 4/8/91";*/
-static char rcsid[] = "$Id: backgammon.c,v 1.2 1993/08/01 18:56:45 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)backgammon.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: backgammon.c,v 1.3 1995/03/21 15:05:31 cgd Exp $";
+#endif
#endif /* not lint */
/*
diff --git a/backgammon/common_source/board.c b/backgammon/common_source/board.c
index 8b1402ab..4936b18a 100644
--- a/backgammon/common_source/board.c
+++ b/backgammon/common_source/board.c
@@ -1,6 +1,8 @@
+/* $NetBSD: board.c,v 1.3 1995/03/21 15:05:34 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)board.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: board.c,v 1.2 1993/08/01 18:56:47 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)board.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: board.c,v 1.3 1995/03/21 15:05:34 cgd Exp $";
+#endif
#endif /* not lint */
#include "back.h"
diff --git a/backgammon/common_source/check.c b/backgammon/common_source/check.c
index ac4e3dcb..25c77c90 100644
--- a/backgammon/common_source/check.c
+++ b/backgammon/common_source/check.c
@@ -1,6 +1,8 @@
+/* $NetBSD: check.c,v 1.3 1995/03/21 15:05:36 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)check.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: check.c,v 1.2 1993/08/01 18:56:44 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)check.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: check.c,v 1.3 1995/03/21 15:05:36 cgd Exp $";
+#endif
#endif /* not lint */
#include "back.h"
diff --git a/backgammon/common_source/fancy.c b/backgammon/common_source/fancy.c
index 88ecfd89..1cc7ee05 100644
--- a/backgammon/common_source/fancy.c
+++ b/backgammon/common_source/fancy.c
@@ -1,6 +1,8 @@
+/* $NetBSD: fancy.c,v 1.3 1995/03/21 15:05:40 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)fancy.c 5.5 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: fancy.c,v 1.2 1993/08/01 18:56:43 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)fancy.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: fancy.c,v 1.3 1995/03/21 15:05:40 cgd Exp $";
+#endif
#endif /* not lint */
#include "back.h"
diff --git a/backgammon/common_source/init.c b/backgammon/common_source/init.c
index 45f297f7..c11d41a6 100644
--- a/backgammon/common_source/init.c
+++ b/backgammon/common_source/init.c
@@ -1,6 +1,8 @@
+/* $NetBSD: init.c,v 1.3 1995/03/21 15:05:44 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)init.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: init.c,v 1.2 1993/08/01 18:56:41 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: init.c,v 1.3 1995/03/21 15:05:44 cgd Exp $";
+#endif
#endif /* not lint */
#include <sgtty.h>
diff --git a/backgammon/common_source/odds.c b/backgammon/common_source/odds.c
index 02354d31..4bf59ea6 100644
--- a/backgammon/common_source/odds.c
+++ b/backgammon/common_source/odds.c
@@ -1,6 +1,8 @@
+/* $NetBSD: odds.c,v 1.3 1995/03/21 15:05:47 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)odds.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: odds.c,v 1.2 1993/08/01 18:56:42 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)odds.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: odds.c,v 1.3 1995/03/21 15:05:47 cgd Exp $";
+#endif
#endif /* not lint */
#include "back.h"
diff --git a/backgammon/common_source/one.c b/backgammon/common_source/one.c
index cb63c72c..4da451a9 100644
--- a/backgammon/common_source/one.c
+++ b/backgammon/common_source/one.c
@@ -1,6 +1,8 @@
+/* $NetBSD: one.c,v 1.3 1995/03/21 15:05:49 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)one.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: one.c,v 1.2 1993/08/01 18:56:39 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)one.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: one.c,v 1.3 1995/03/21 15:05:49 cgd Exp $";
+#endif
#endif /* not lint */
#include "back.h"
diff --git a/backgammon/common_source/save.c b/backgammon/common_source/save.c
index 9433306b..bba3dddb 100644
--- a/backgammon/common_source/save.c
+++ b/backgammon/common_source/save.c
@@ -1,6 +1,8 @@
+/* $NetBSD: save.c,v 1.3 1995/03/21 15:05:52 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)save.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: save.c,v 1.2 1993/08/01 18:56:38 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: save.c,v 1.3 1995/03/21 15:05:52 cgd Exp $";
+#endif
#endif /* not lint */
#include "back.h"
diff --git a/backgammon/common_source/subs.c b/backgammon/common_source/subs.c
index c1b0e8ee..1baefbe5 100644
--- a/backgammon/common_source/subs.c
+++ b/backgammon/common_source/subs.c
@@ -1,6 +1,8 @@
+/* $NetBSD: subs.c,v 1.3 1995/03/21 15:05:54 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)subs.c 5.5 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: subs.c,v 1.2 1993/08/01 18:56:37 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)subs.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: subs.c,v 1.3 1995/03/21 15:05:54 cgd Exp $";
+#endif
#endif /* not lint */
#include <stdio.h>
diff --git a/backgammon/common_source/table.c b/backgammon/common_source/table.c
index a46a50dd..c330628d 100644
--- a/backgammon/common_source/table.c
+++ b/backgammon/common_source/table.c
@@ -1,6 +1,8 @@
+/* $NetBSD: table.c,v 1.3 1995/03/21 15:05:58 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)table.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: table.c,v 1.2 1993/08/01 18:56:35 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)table.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: table.c,v 1.3 1995/03/21 15:05:58 cgd Exp $";
+#endif
#endif /* not lint */
#include "back.h"
diff --git a/backgammon/teachgammon/Makefile b/backgammon/teachgammon/Makefile
index 04b60d9e..0fd1aff9 100644
--- a/backgammon/teachgammon/Makefile
+++ b/backgammon/teachgammon/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.1 (Berkeley) 5/11/90
-# $Id: Makefile,v 1.4 1994/05/23 05:40:08 cgd Exp $
+# $NetBSD: Makefile,v 1.5 1995/03/21 15:06:07 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= teachgammon
CFLAGS+=-DV7 -I${.CURDIR}/../common_source
diff --git a/backgammon/teachgammon/data.c b/backgammon/teachgammon/data.c
index 306e02ec..0c7b724c 100644
--- a/backgammon/teachgammon/data.c
+++ b/backgammon/teachgammon/data.c
@@ -1,6 +1,8 @@
+/* $NetBSD: data.c,v 1.3 1995/03/21 15:06:10 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)data.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: data.c,v 1.2 1993/08/01 18:56:29 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)data.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: data.c,v 1.3 1995/03/21 15:06:10 cgd Exp $";
+#endif
#endif /* not lint */
#include "tutor.h"
diff --git a/backgammon/teachgammon/teach.c b/backgammon/teachgammon/teach.c
index 60a66182..a1f493e8 100644
--- a/backgammon/teachgammon/teach.c
+++ b/backgammon/teachgammon/teach.c
@@ -1,6 +1,8 @@
+/* $NetBSD: teach.c,v 1.3 1995/03/21 15:06:13 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,14 +34,17 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1980 Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1980, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)teach.c 5.6 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: teach.c,v 1.2 1993/08/01 18:56:28 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)teach.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: teach.c,v 1.3 1995/03/21 15:06:13 cgd Exp $";
+#endif
#endif /* not lint */
#include "back.h"
diff --git a/backgammon/teachgammon/ttext1.c b/backgammon/teachgammon/ttext1.c
index 8f40d729..100b5e45 100644
--- a/backgammon/teachgammon/ttext1.c
+++ b/backgammon/teachgammon/ttext1.c
@@ -1,6 +1,8 @@
+/* $NetBSD: ttext1.c,v 1.3 1995/03/21 15:06:17 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)ttext1.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: ttext1.c,v 1.2 1993/08/01 18:56:27 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)ttext1.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: ttext1.c,v 1.3 1995/03/21 15:06:17 cgd Exp $";
+#endif
#endif /* not lint */
#include "back.h"
diff --git a/backgammon/teachgammon/ttext2.c b/backgammon/teachgammon/ttext2.c
index b5ae9fc8..07a857a8 100644
--- a/backgammon/teachgammon/ttext2.c
+++ b/backgammon/teachgammon/ttext2.c
@@ -1,6 +1,8 @@
+/* $NetBSD: ttext2.c,v 1.3 1995/03/21 15:06:22 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)ttext2.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: ttext2.c,v 1.2 1993/08/01 18:56:26 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)ttext2.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: ttext2.c,v 1.3 1995/03/21 15:06:22 cgd Exp $";
+#endif
#endif /* not lint */
#include "back.h"
diff --git a/backgammon/teachgammon/tutor.c b/backgammon/teachgammon/tutor.c
index 04364857..497191ee 100644
--- a/backgammon/teachgammon/tutor.c
+++ b/backgammon/teachgammon/tutor.c
@@ -1,6 +1,8 @@
+/* $NetBSD: tutor.c,v 1.3 1995/03/21 15:06:27 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)tutor.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: tutor.c,v 1.2 1993/08/01 18:56:24 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)tutor.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: tutor.c,v 1.3 1995/03/21 15:06:27 cgd Exp $";
+#endif
#endif /* not lint */
#include "back.h"
diff --git a/backgammon/teachgammon/tutor.h b/backgammon/teachgammon/tutor.h
index 3f3b5e15..bfafd43f 100644
--- a/backgammon/teachgammon/tutor.h
+++ b/backgammon/teachgammon/tutor.h
@@ -1,6 +1,8 @@
+/* $NetBSD: tutor.h,v 1.3 1995/03/21 15:06:30 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,8 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)tutor.h 5.4 (Berkeley) 6/1/90
- * $Id: tutor.h,v 1.2 1993/08/01 18:56:30 mycroft Exp $
+ * @(#)tutor.h 8.1 (Berkeley) 5/31/93
*/
struct situatn {
diff --git a/battlestar/Makefile b/battlestar/Makefile
index cae67db4..f187de46 100644
--- a/battlestar/Makefile
+++ b/battlestar/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.5 (Berkeley) 5/11/90
-# $Id: Makefile,v 1.4 1994/12/22 09:33:04 cgd Exp $
+# $NetBSD: Makefile,v 1.5 1995/03/21 15:06:38 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= battlestar
SRCS= battlestar.c com1.c com2.c com3.c com4.c com5.c com6.c com7.c \
diff --git a/battlestar/battlestar.6 b/battlestar/battlestar.6
index 4dc50b09..a6dda29e 100644
--- a/battlestar/battlestar.6
+++ b/battlestar/battlestar.6
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: battlestar.6,v 1.4 1995/03/21 15:06:42 cgd Exp $
+.\"
+.\" Copyright (c) 1983, 1993
+.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -29,10 +31,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)battlestar.6 1.4 (Berkeley) 6/23/90
-.\" $Id: battlestar.6,v 1.3 1993/08/05 16:40:44 jtc Exp $
+.\" @(#)battlestar.6 8.1 (Berkeley) 5/31/93
.\"
-.Dd June 23, 1990
+.Dd May 31, 1993
.Dt BATTLESTAR 6
.Os
.Sh NAME
diff --git a/battlestar/battlestar.c b/battlestar/battlestar.c
index 7f4cfe92..078adb98 100644
--- a/battlestar/battlestar.c
+++ b/battlestar/battlestar.c
@@ -1,6 +1,8 @@
+/* $NetBSD: battlestar.c,v 1.3 1995/03/21 15:06:47 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,14 +34,17 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1983 Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1983, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)battlestar.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: battlestar.c,v 1.2 1993/08/01 18:56:14 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)battlestar.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: battlestar.c,v 1.3 1995/03/21 15:06:47 cgd Exp $";
+#endif
#endif /* not lint */
/*
diff --git a/battlestar/com1.c b/battlestar/com1.c
index f1ac5f6b..136e3aa7 100644
--- a/battlestar/com1.c
+++ b/battlestar/com1.c
@@ -1,6 +1,8 @@
+/* $NetBSD: com1.c,v 1.3 1995/03/21 15:06:51 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)com1.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: com1.c,v 1.2 1993/08/01 18:56:13 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)com1.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: com1.c,v 1.3 1995/03/21 15:06:51 cgd Exp $";
+#endif
#endif /* not lint */
#include "externs.h"
diff --git a/battlestar/com2.c b/battlestar/com2.c
index 051eb72c..69a4ca14 100644
--- a/battlestar/com2.c
+++ b/battlestar/com2.c
@@ -1,6 +1,8 @@
+/* $NetBSD: com2.c,v 1.3 1995/03/21 15:06:55 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)com2.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: com2.c,v 1.2 1993/08/01 18:56:12 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)com2.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: com2.c,v 1.3 1995/03/21 15:06:55 cgd Exp $";
+#endif
#endif /* not lint */
#include "externs.h"
diff --git a/battlestar/com3.c b/battlestar/com3.c
index 1e24684b..1bb1889d 100644
--- a/battlestar/com3.c
+++ b/battlestar/com3.c
@@ -1,6 +1,8 @@
+/* $NetBSD: com3.c,v 1.3 1995/03/21 15:07:00 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)com3.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: com3.c,v 1.2 1993/08/01 18:56:09 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)com3.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: com3.c,v 1.3 1995/03/21 15:07:00 cgd Exp $";
+#endif
#endif /* not lint */
#include "externs.h"
diff --git a/battlestar/com4.c b/battlestar/com4.c
index 3034fd75..93e17fff 100644
--- a/battlestar/com4.c
+++ b/battlestar/com4.c
@@ -1,6 +1,8 @@
+/* $NetBSD: com4.c,v 1.3 1995/03/21 15:07:04 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)com4.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: com4.c,v 1.2 1993/08/01 18:56:11 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)com4.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: com4.c,v 1.3 1995/03/21 15:07:04 cgd Exp $";
+#endif
#endif /* not lint */
#include "externs.h"
diff --git a/battlestar/com5.c b/battlestar/com5.c
index 5b1f143a..205bd1ad 100644
--- a/battlestar/com5.c
+++ b/battlestar/com5.c
@@ -1,6 +1,8 @@
+/* $NetBSD: com5.c,v 1.3 1995/03/21 15:07:07 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)com5.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: com5.c,v 1.2 1993/08/01 18:56:08 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)com5.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: com5.c,v 1.3 1995/03/21 15:07:07 cgd Exp $";
+#endif
#endif /* not lint */
#include "externs.h"
diff --git a/battlestar/com6.c b/battlestar/com6.c
index ddf30d2a..b1f48290 100644
--- a/battlestar/com6.c
+++ b/battlestar/com6.c
@@ -1,6 +1,8 @@
+/* $NetBSD: com6.c,v 1.3 1995/03/21 15:07:09 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)com6.c 5.5 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: com6.c,v 1.2 1993/08/01 18:56:07 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)com6.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: com6.c,v 1.3 1995/03/21 15:07:09 cgd Exp $";
+#endif
#endif /* not lint */
#include "externs.h"
diff --git a/battlestar/com7.c b/battlestar/com7.c
index 0ff9cb53..abe88577 100644
--- a/battlestar/com7.c
+++ b/battlestar/com7.c
@@ -1,6 +1,8 @@
+/* $NetBSD: com7.c,v 1.3 1995/03/21 15:07:12 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)com7.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: com7.c,v 1.2 1993/08/01 18:56:06 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)com7.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: com7.c,v 1.3 1995/03/21 15:07:12 cgd Exp $";
+#endif
#endif /* not lint */
#include "externs.h"
diff --git a/battlestar/cypher.c b/battlestar/cypher.c
index 238bf49e..8d5d3f30 100644
--- a/battlestar/cypher.c
+++ b/battlestar/cypher.c
@@ -1,6 +1,8 @@
+/* $NetBSD: cypher.c,v 1.3 1995/03/21 15:07:15 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)cypher.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: cypher.c,v 1.2 1993/08/01 18:56:03 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)cypher.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: cypher.c,v 1.3 1995/03/21 15:07:15 cgd Exp $";
+#endif
#endif /* not lint */
#include "externs.h"
diff --git a/battlestar/dayfile.c b/battlestar/dayfile.c
index 0d368548..ed511fae 100644
--- a/battlestar/dayfile.c
+++ b/battlestar/dayfile.c
@@ -1,6 +1,8 @@
+/* $NetBSD: dayfile.c,v 1.3 1995/03/21 15:07:18 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)dayfile.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: dayfile.c,v 1.2 1993/08/01 18:56:04 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)dayfile.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: dayfile.c,v 1.3 1995/03/21 15:07:18 cgd Exp $";
+#endif
#endif /* not lint */
#include "externs.h"
diff --git a/battlestar/dayobjs.c b/battlestar/dayobjs.c
index cdf16d16..819ffb96 100644
--- a/battlestar/dayobjs.c
+++ b/battlestar/dayobjs.c
@@ -1,6 +1,8 @@
+/* $NetBSD: dayobjs.c,v 1.3 1995/03/21 15:07:22 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)dayobjs.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: dayobjs.c,v 1.2 1993/08/01 18:56:02 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)dayobjs.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: dayobjs.c,v 1.3 1995/03/21 15:07:22 cgd Exp $";
+#endif
#endif /* not lint */
#include "externs.h"
diff --git a/battlestar/externs.h b/battlestar/externs.h
index 38ea5771..2af7978b 100644
--- a/battlestar/externs.h
+++ b/battlestar/externs.h
@@ -1,6 +1,8 @@
+/* $NetBSD: externs.h,v 1.4 1995/03/21 15:07:25 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,8 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)externs.h 5.4 (Berkeley) 6/1/90
- * $Id: externs.h,v 1.3 1995/02/28 18:31:09 jtc Exp $
+ * @(#)externs.h 8.1 (Berkeley) 5/31/93
*/
#include <signal.h>
diff --git a/battlestar/fly.c b/battlestar/fly.c
index 663cf739..b98364e9 100644
--- a/battlestar/fly.c
+++ b/battlestar/fly.c
@@ -1,6 +1,8 @@
+/* $NetBSD: fly.c,v 1.3 1995/03/21 15:07:28 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)fly.c 5.6 (Berkeley) 3/4/91";*/
-static char rcsid[] = "$Id: fly.c,v 1.2 1993/08/01 18:56:01 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)fly.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: fly.c,v 1.3 1995/03/21 15:07:28 cgd Exp $";
+#endif
#endif /* not lint */
#include "externs.h"
@@ -69,7 +74,6 @@ visual()
void moveenemy();
destroyed = 0;
- savetty();
if(initscr() == ERR){
puts("Whoops! No more memory...");
return(0);
diff --git a/battlestar/getcom.c b/battlestar/getcom.c
index 6674304a..d6726de0 100644
--- a/battlestar/getcom.c
+++ b/battlestar/getcom.c
@@ -1,6 +1,8 @@
+/* $NetBSD: getcom.c,v 1.3 1995/03/21 15:07:30 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)getcom.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: getcom.c,v 1.2 1993/08/01 18:56:00 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)getcom.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: getcom.c,v 1.3 1995/03/21 15:07:30 cgd Exp $";
+#endif
#endif /* not lint */
#include <stdio.h>
diff --git a/battlestar/globals.c b/battlestar/globals.c
index 485be664..66f5af63 100644
--- a/battlestar/globals.c
+++ b/battlestar/globals.c
@@ -1,6 +1,8 @@
+/* $NetBSD: globals.c,v 1.3 1995/03/21 15:07:32 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)globals.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: globals.c,v 1.2 1993/08/01 18:55:58 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)globals.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: globals.c,v 1.3 1995/03/21 15:07:32 cgd Exp $";
+#endif
#endif /* not lint */
#include "externs.h"
diff --git a/battlestar/init.c b/battlestar/init.c
index 6a6a6b5b..2a798ee1 100644
--- a/battlestar/init.c
+++ b/battlestar/init.c
@@ -1,6 +1,8 @@
+/* $NetBSD: init.c,v 1.4 1995/03/21 15:07:35 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)init.c 5.5 (Berkeley) 2/27/91";*/
-static char rcsid[] = "$Id: init.c,v 1.3 1993/08/01 18:55:59 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: init.c,v 1.4 1995/03/21 15:07:35 cgd Exp $";
+#endif
#endif /* not lint */
#include <sys/types.h>
diff --git a/battlestar/misc.c b/battlestar/misc.c
index b37c1259..590760bf 100644
--- a/battlestar/misc.c
+++ b/battlestar/misc.c
@@ -1,6 +1,8 @@
+/* $NetBSD: misc.c,v 1.3 1995/03/21 15:07:37 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)misc.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: misc.c,v 1.2 1993/08/01 18:55:58 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: misc.c,v 1.3 1995/03/21 15:07:37 cgd Exp $";
+#endif
#endif /* not lint */
#include "externs.h"
diff --git a/battlestar/nightfile.c b/battlestar/nightfile.c
index b446e655..91c901ff 100644
--- a/battlestar/nightfile.c
+++ b/battlestar/nightfile.c
@@ -1,6 +1,8 @@
+/* $NetBSD: nightfile.c,v 1.3 1995/03/21 15:07:41 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)nightfile.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: nightfile.c,v 1.2 1993/08/01 18:55:56 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)nightfile.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: nightfile.c,v 1.3 1995/03/21 15:07:41 cgd Exp $";
+#endif
#endif /* not lint */
#include "externs.h"
diff --git a/battlestar/nightobjs.c b/battlestar/nightobjs.c
index 5cc08730..e3efd2d9 100644
--- a/battlestar/nightobjs.c
+++ b/battlestar/nightobjs.c
@@ -1,6 +1,8 @@
+/* $NetBSD: nightobjs.c,v 1.3 1995/03/21 15:07:46 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)nightobjs.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: nightobjs.c,v 1.2 1993/08/01 18:55:55 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)nightobjs.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: nightobjs.c,v 1.3 1995/03/21 15:07:46 cgd Exp $";
+#endif
#endif /* not lint */
#include "externs.h"
diff --git a/battlestar/parse.c b/battlestar/parse.c
index 4a4919b7..27add0c7 100644
--- a/battlestar/parse.c
+++ b/battlestar/parse.c
@@ -1,6 +1,8 @@
+/* $NetBSD: parse.c,v 1.3 1995/03/21 15:07:48 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)parse.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: parse.c,v 1.2 1993/08/01 18:55:53 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: parse.c,v 1.3 1995/03/21 15:07:48 cgd Exp $";
+#endif
#endif /* not lint */
#include "externs.h"
diff --git a/battlestar/pathnames.h b/battlestar/pathnames.h
index 141dc7df..26413952 100644
--- a/battlestar/pathnames.h
+++ b/battlestar/pathnames.h
@@ -1,6 +1,8 @@
+/* $NetBSD: pathnames.h,v 1.3 1995/03/21 15:07:51 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,8 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)pathnames.h 5.1 (Berkeley) 6/1/90
- * $Id: pathnames.h,v 1.2 1993/08/01 18:56:14 mycroft Exp $
+ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93
*/
#define _PATH_SCORE "/var/games/battlestar.log"
diff --git a/battlestar/room.c b/battlestar/room.c
index 3ff7d586..631baf9d 100644
--- a/battlestar/room.c
+++ b/battlestar/room.c
@@ -1,6 +1,8 @@
+/* $NetBSD: room.c,v 1.3 1995/03/21 15:07:54 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)room.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: room.c,v 1.2 1993/08/01 18:55:54 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)room.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: room.c,v 1.3 1995/03/21 15:07:54 cgd Exp $";
+#endif
#endif /* not lint */
#include "externs.h"
diff --git a/battlestar/save.c b/battlestar/save.c
index f8faf513..85c85951 100644
--- a/battlestar/save.c
+++ b/battlestar/save.c
@@ -1,6 +1,8 @@
+/* $NetBSD: save.c,v 1.3 1995/03/21 15:07:57 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)save.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: save.c,v 1.2 1993/08/01 18:55:52 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: save.c,v 1.3 1995/03/21 15:07:57 cgd Exp $";
+#endif
#endif /* not lint */
#include "externs.h"
diff --git a/battlestar/words.c b/battlestar/words.c
index 0f4c3d93..64dac12a 100644
--- a/battlestar/words.c
+++ b/battlestar/words.c
@@ -1,6 +1,8 @@
+/* $NetBSD: words.c,v 1.3 1995/03/21 15:08:00 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,8 +34,11 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)words.c 5.3 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: words.c,v 1.2 1993/08/01 18:55:50 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)words.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: words.c,v 1.3 1995/03/21 15:08:00 cgd Exp $";
+#endif
#endif /* not lint */
#include "externs.h"
diff --git a/bcd/Makefile b/bcd/Makefile
index 0c88ca46..5b3237f2 100644
--- a/bcd/Makefile
+++ b/bcd/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.3 (Berkeley) 5/11/90
-# $Id: Makefile,v 1.3 1994/12/22 09:33:11 cgd Exp $
+# $NetBSD: Makefile,v 1.4 1995/03/21 15:08:10 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= bcd
MAN= bcd.6
diff --git a/bcd/bcd.6 b/bcd/bcd.6
index c8b785d5..57efb7a5 100644
--- a/bcd/bcd.6
+++ b/bcd/bcd.6
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1988 Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: bcd.6,v 1.6 1995/03/21 15:08:14 cgd Exp $
+.\"
+.\" Copyright (c) 1988, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -29,16 +31,15 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)bcd.6 6.7 (Berkeley) 6/23/90
-.\" $Id: bcd.6,v 1.5 1994/03/24 01:27:24 jtc Exp $
+.\" @(#)bcd.6 8.1 (Berkeley) 5/31/93
.\"
-.Dd June 23, 1990
-.Dt BCD 6
+.Dd May 31, 1993
+.Dt "BCD" 6
.Os
.Sh NAME
.Nm bcd ,
.Nm ppt ,
-.Nm morse
+.Nm morse
.Nd "reformat input as punch cards, paper tape or morse code"
.Sh SYNOPSIS
.Nm bcd
@@ -46,17 +47,23 @@
.Nm ppt
.Op Ar string ...
.Nm morse
-.Op Fl s
-.Op Ar string ...
+.Op Fl s Ar string ...
.Sh DESCRIPTION
-.Nm Bcd ,
+The
+.Nm bcd ,
.Nm ppt
and
.Nm morse
-convert command line arguments, if provided, or standard input into a form
-familiar to old-timers.
+commands read the given input and reformats it in the form of
+punched cards, paper tape or morse code respectively.
+Acceptable input are command line arguments or the standard input.
+.Pp
+Available option:
+.Bl -tag -width flag
+.It Fl s
The
.Fl s
-option for
-.Nm morse
-produces dots and dashes rather than words.
+option for morse produces dots and dashes rather than words.
+.El
+.Sh FILES
+.SH HISTORY
diff --git a/bcd/bcd.c b/bcd/bcd.c
index ef50737a..ea554a34 100644
--- a/bcd/bcd.c
+++ b/bcd/bcd.c
@@ -1,9 +1,11 @@
+/* $NetBSD: bcd.c,v 1.5 1995/03/21 15:08:15 cgd Exp $ */
+
/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
- * Steve Hayman of the Indiana University Computer Science Dept..
+ * Steve Hayman of the Indiana University Computer Science Dept.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -35,14 +37,13 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1989 The Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1989, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)bcd.c 4.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: bcd.c,v 1.4 1993/11/05 20:22:35 jtc Exp $";
+static char sccsid[] = "@(#)bcd.c 8.2 (Berkeley) 3/20/94";
#endif /* not lint */
/*
@@ -61,9 +62,22 @@ static char rcsid[] = "$Id: bcd.c,v 1.4 1993/11/05 20:22:35 jtc Exp $";
* Steve Hayman
* sahayman@iuvax.cs.indiana.edu
* 1989 11 30
+ *
+ *
+ * I found an error in the table. The same error is found in the SunOS 4.1.1
+ * version of bcd. It has apparently been around a long time. The error caused
+ * 'Q' and 'R' to have the same punch code. I only noticed the error due to
+ * someone pointing it out to me when the program was used to print a cover
+ * for an APA! The table was wrong in 4 places. The other error was masked
+ * by the fact that the input is converted to upper case before lookup.
+ *
+ * Dyane Bruce
+ * db@diana.ocunix.on.ca
+ * Nov 5, 1993
*/
#include <sys/types.h>
+
#include <stdio.h>
#include <ctype.h>
@@ -107,6 +121,7 @@ u_short holes[256] = {
*/
#define bit(w,i) ((w)&(1<<(i)))
+int
main(argc, argv)
int argc;
char **argv;
diff --git a/caesar/Makefile b/caesar/Makefile
index fe9d2272..c2fefd8f 100644
--- a/caesar/Makefile
+++ b/caesar/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.2 (Berkeley) 5/11/90
-# $Id: Makefile,v 1.3 1994/12/22 09:33:32 cgd Exp $
+# $NetBSD: Makefile,v 1.4 1995/03/21 15:08:18 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= caesar
MAN= caesar.6
@@ -7,4 +7,8 @@ DPADD= ${LIBM}
LDADD= -lm
MLINKS= caesar.6 rot13.6
+beforeinstall:
+ install -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
+ ${.CURDIR}/rot13.sh ${DESTDIR}/usr/games/rot13
+
.include <bsd.prog.mk>
diff --git a/caesar/caesar.6 b/caesar/caesar.6
index 76dc20a6..12615368 100644
--- a/caesar/caesar.6
+++ b/caesar/caesar.6
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1989 The Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: caesar.6,v 1.4 1995/03/21 15:08:20 cgd Exp $
+.\"
+.\" Copyright (c) 1989, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -29,10 +31,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)caesar.6 5.3 (Berkeley) 11/11/90
-.\" $Id: caesar.6,v 1.3 1993/08/05 01:46:33 jtc Exp $
+.\" @(#)caesar.6 8.2 (Berkeley) 11/16/93
.\"
-.Dd November 11, 1990
+.Dd November 16, 1993
.Dt CAESAR 6
.Os
.Sh NAME
@@ -54,17 +55,22 @@ The optional numerical argument
may be used to specify a specific rotation value.
.Pp
The frequency (from most common to least) of English letters is as follows:
+.Pp
.Bd -filled -offset indent
ETAONRISHDLFCMUGPYWBVKXJQZ
.Ed
.Pp
Their frequencies as a percentage are as follows:
+.Pp
.Bd -filled -offset indent
E(13), T(10.5), A(8.1), O(7.9), N(7.1), R(6.8), I(6.3), S(6.1), H(5.2),
-D(3.8), L(3.4), F(2.9), C(2.7), M(2.5), U(2.4), G(2), P(1.9), Y(1.9),
+D(3.8), L(3.4), F(2.9), C(2.7), M(2.5), U(2.4), G(2),
+P(1.9), Y(1.9),
W(1.5), B(1.4), V(.9), K(.4), X(.15), J(.13), Q(.11), Z(.07).
.Ed
.Pp
-Rotated postings to USENET and some of the databases used by the
+Rotated postings to
+.Tn USENET
+and some of the databases used by the
.Xr fortune 6
program are rotated by 13 characters.
diff --git a/caesar/caesar.c b/caesar/caesar.c
index 6c968bd2..de5a2e8a 100644
--- a/caesar/caesar.c
+++ b/caesar/caesar.c
@@ -1,6 +1,8 @@
+/* $NetBSD: caesar.c,v 1.3 1995/03/21 15:08:21 cgd Exp $ */
+
/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Rick Adams.
@@ -40,14 +42,17 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1989 The Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1989, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)caesar.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: caesar.c,v 1.2 1993/08/01 18:55:37 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)caesar.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: caesar.c,v 1.3 1995/03/21 15:08:21 cgd Exp $";
+#endif
#endif /* not lint */
#include <math.h>
diff --git a/caesar/rot13.sh b/caesar/rot13.sh
index 93fb9355..66297fd0 100644
--- a/caesar/rot13.sh
+++ b/caesar/rot13.sh
@@ -1,4 +1,5 @@
#!/bin/sh -
+# $NetBSD: rot13.sh,v 1.2 1995/03/21 15:08:23 cgd Exp $
#
# Copyright (c) 1992, 1993
# The Regents of the University of California. All rights reserved.
diff --git a/canfield/Makefile b/canfield/Makefile
index 2fff16fc..c656887f 100644
--- a/canfield/Makefile
+++ b/canfield/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.1 (Berkeley) 4/8/91
-# $Id: Makefile,v 1.2 1993/08/01 05:45:51 mycroft Exp $
+# $NetBSD: Makefile,v 1.3 1995/03/21 15:08:26 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
SUBDIR= canfield cfscores
diff --git a/canfield/canfield/Makefile b/canfield/canfield/Makefile
index aa8e3f13..58772169 100644
--- a/canfield/canfield/Makefile
+++ b/canfield/canfield/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.7 (Berkeley) 4/8/91
-# $Id: Makefile,v 1.4 1994/12/22 09:33:46 cgd Exp $
+# $NetBSD: Makefile,v 1.5 1995/03/21 15:08:28 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= canfield
MAN= canfield.6
diff --git a/canfield/canfield/canfield.6 b/canfield/canfield/canfield.6
index 663af576..17b34ae3 100644
--- a/canfield/canfield/canfield.6
+++ b/canfield/canfield/canfield.6
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1983 The Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: canfield.6,v 1.4 1995/03/21 15:08:30 cgd Exp $
+.\"
+.\" Copyright (c) 1983, 1993
+.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -29,10 +31,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)canfield.6 6.5 (Berkeley) 6/23/90
-.\" $Id: canfield.6,v 1.3 1993/08/05 03:38:03 jtc Exp $
+.\" @(#)canfield.6 8.1 (Berkeley) 5/31/93
.\"
-.Dd June 23, 1990
+.Dd May 31, 1993
.Dt CANFIELD 6
.Os
.Sh NAME
diff --git a/canfield/canfield/canfield.c b/canfield/canfield/canfield.c
index e4b14c1d..d9e335b4 100644
--- a/canfield/canfield/canfield.c
+++ b/canfield/canfield/canfield.c
@@ -1,6 +1,8 @@
+/* $NetBSD: canfield.c,v 1.5 1995/03/21 15:08:32 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,14 +34,17 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1980 Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1980, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)canfield.c 5.11 (Berkeley) 2/28/91";*/
-static char rcsid[] = "$Id: canfield.c,v 1.4 1995/02/28 18:31:17 jtc Exp $";
+#if 0
+static char sccsid[] = "@(#)canfield.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: canfield.c,v 1.5 1995/03/21 15:08:32 cgd Exp $";
+#endif
#endif /* not lint */
/*
@@ -54,10 +59,13 @@ static char rcsid[] = "$Id: canfield.c,v 1.4 1995/02/28 18:31:17 jtc Exp $";
*/
#include <sys/types.h>
-#include <signal.h>
+
#include <curses.h>
#include <termios.h>
#include <ctype.h>
+#include <signal.h>
+#include <termios.h>
+
#include "pathnames.h"
#define decksize 52
diff --git a/canfield/canfield/pathnames.h b/canfield/canfield/pathnames.h
index 7ed32dad..4ecb7bb9 100644
--- a/canfield/canfield/pathnames.h
+++ b/canfield/canfield/pathnames.h
@@ -1,6 +1,8 @@
+/* $NetBSD: pathnames.h,v 1.3 1995/03/21 15:08:34 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,8 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)pathnames.h 5.1 (Berkeley) 4/30/90
- * $Id: pathnames.h,v 1.2 1993/08/01 18:55:30 mycroft Exp $
+ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93
*/
#define _PATH_SCORE "/var/games/cfscores"
diff --git a/canfield/cfscores/Makefile b/canfield/cfscores/Makefile
index 74ca6cc2..bdc6269f 100644
--- a/canfield/cfscores/Makefile
+++ b/canfield/cfscores/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.2 (Berkeley) 4/8/91
-# $Id: Makefile,v 1.2 1993/08/01 05:45:46 mycroft Exp $
+# $NetBSD: Makefile,v 1.3 1995/03/21 15:08:36 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= cfscores
CFLAGS+=-I${.CURDIR}/../canfield
diff --git a/canfield/cfscores/cfscores.c b/canfield/cfscores/cfscores.c
index da9df376..4a3a0e8f 100644
--- a/canfield/cfscores/cfscores.c
+++ b/canfield/cfscores/cfscores.c
@@ -1,6 +1,8 @@
+/* $NetBSD: cfscores.c,v 1.3 1995/03/21 15:08:37 cgd Exp $ */
+
/*
- * Copyright (c) 1983 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1983, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,14 +34,17 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1983 Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1983, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)cfscores.c 5.6 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: cfscores.c,v 1.2 1993/08/01 18:55:25 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)cfscores.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: cfscores.c,v 1.3 1995/03/21 15:08:37 cgd Exp $";
+#endif
#endif /* not lint */
#include <sys/types.h>
diff --git a/cribbage/Makefile b/cribbage/Makefile
index c5c7522e..69c60d77 100644
--- a/cribbage/Makefile
+++ b/cribbage/Makefile
@@ -1,5 +1,5 @@
-# from: @(#)Makefile 5.11 (Berkeley) 5/11/90
-# $Id: Makefile,v 1.4 1994/12/22 09:33:52 cgd Exp $
+# $NetBSD: Makefile,v 1.5 1995/03/21 15:08:39 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
PROG= cribbage
DPADD= ${LIBCURSES} ${LIBTERM}
diff --git a/cribbage/cards.c b/cribbage/cards.c
index 16927fa9..a81bdf65 100644
--- a/cribbage/cards.c
+++ b/cribbage/cards.c
@@ -1,6 +1,8 @@
-/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+/* $NetBSD: cards.c,v 1.3 1995/03/21 15:08:41 cgd Exp $ */
+
+/*-
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,131 +34,118 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)cards.c 5.5 (Berkeley) 2/28/91";*/
-static char rcsid[] = "$Id: cards.c,v 1.2 1993/08/01 18:55:16 mycroft Exp $";
+static char sccsid[] = "@(#)cards.c 8.1 (Berkeley) 5/31/93";
#endif /* not lint */
-#include <stdio.h>
-#include "deck.h"
+#include <curses.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+
+#include "deck.h"
+#include "cribbage.h"
/*
- * initialize a deck of cards to contain one of each type
+ * Initialize a deck of cards to contain one of each type.
*/
-
-makedeck( d )
-
- CARD d[];
+void
+makedeck(d)
+ CARD d[];
{
- register int i, j, k;
- long time();
+ register int i, j, k;
- i = time( (long *) 0 );
- i = ( (i&0xff) << 8 ) | ( (i >> 8)&0xff ) | 1;
- srand( i );
+ i = time(NULL);
+ i = ((i & 0xff) << 8) | ((i >> 8) & 0xff) | 1;
+ srand(i);
k = 0;
- for( i = 0; i < RANKS; i++ ) {
- for( j = 0; j < SUITS; j++ ) {
- d[k].suit = j;
- d[k++].rank = i;
- }
- }
+ for (i = 0; i < RANKS; i++)
+ for (j = 0; j < SUITS; j++) {
+ d[k].suit = j;
+ d[k++].rank = i;
+ }
}
-
-
/*
- * given a deck of cards, shuffle it -- i.e. randomize it
- * see Knuth, vol. 2, page 125
+ * Given a deck of cards, shuffle it -- i.e. randomize it
+ * see Knuth, vol. 2, page 125.
*/
-
-shuffle( d )
-
- CARD d[];
+void
+shuffle(d)
+ CARD d[];
{
- register int j, k;
- CARD c;
-
- for( j = CARDS; j > 0; --j ) {
- k = ( rand() >> 4 ) % j; /* random 0 <= k < j */
- c = d[j - 1]; /* exchange (j - 1) and k */
- d[j - 1] = d[k];
- d[k] = c;
+ register int j, k;
+ CARD c;
+
+ for (j = CARDS; j > 0; --j) {
+ k = (rand() >> 4) % j; /* random 0 <= k < j */
+ c = d[j - 1]; /* exchange (j - 1) and k */
+ d[j - 1] = d[k];
+ d[k] = c;
}
}
-
-
/*
* return true if the two cards are equal...
*/
-
-eq( a, b )
-
- CARD a, b;
+int
+eq(a, b)
+ CARD a, b;
{
- return( ( a.rank == b.rank ) && ( a.suit == b.suit ) );
+ return ((a.rank == b.rank) && (a.suit == b.suit));
}
-
-
/*
* isone returns TRUE if a is in the set of cards b
*/
-
-isone( a, b, n )
-
- CARD a, b[];
- int n;
+int
+isone(a, b, n)
+ CARD a, b[];
+ int n;
{
- register int i;
+ register int i;
- for( i = 0; i < n; i++ ) {
- if( eq( a, b[i] ) ) return( TRUE );
- }
- return( FALSE );
+ for (i = 0; i < n; i++)
+ if (eq(a, b[i]))
+ return (TRUE);
+ return (FALSE);
}
-
-
/*
* remove the card a from the deck d of n cards
*/
-
-cremove( a, d, n )
-
- CARD a, d[];
- int n;
+void
+cremove(a, d, n)
+ CARD a, d[];
+ int n;
{
- register int i, j;
+ register int i, j;
- j = 0;
- for( i = 0; i < n; i++ ) {
- if( !eq( a, d[i] ) ) d[j++] = d[i];
- }
- if( j < n ) d[j].suit = d[j].rank = EMPTY;
+ for (i = j = 0; i < n; i++)
+ if (!eq(a, d[i]))
+ d[j++] = d[i];
+ if (j < n)
+ d[j].suit = d[j].rank = EMPTY;
}
-
-
/*
* sorthand:
* Sort a hand of n cards
*/
+void
sorthand(h, n)
-register CARD h[];
-int n;
+ register CARD h[];
+ int n;
{
- register CARD *cp, *endp;
- CARD c;
+ register CARD *cp, *endp;
+ CARD c;
for (endp = &h[n]; h < endp - 1; h++)
- for (cp = h + 1; cp < endp; cp++)
- if ((cp->rank < h->rank) ||
- (cp->rank == h->rank && cp->suit < h->suit)) {
- c = *h;
- *h = *cp;
- *cp = c;
- }
+ for (cp = h + 1; cp < endp; cp++)
+ if ((cp->rank < h->rank) ||
+ (cp->rank == h->rank && cp->suit < h->suit)) {
+ c = *h;
+ *h = *cp;
+ *cp = c;
+ }
}
-
diff --git a/cribbage/crib.c b/cribbage/crib.c
index c357f2da..96bfe568 100644
--- a/cribbage/crib.c
+++ b/cribbage/crib.c
@@ -1,6 +1,8 @@
-/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+/* $NetBSD: crib.c,v 1.5 1995/03/21 15:08:42 cgd Exp $ */
+
+/*-
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,41 +34,41 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1980 Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1980, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)crib.c 5.6 (Berkeley) 2/28/91";*/
-static char rcsid[] = "$Id: crib.c,v 1.4 1995/02/28 18:31:26 jtc Exp $";
+#if 0
+static char sccsid[] = "@(#)crib.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: crib.c,v 1.5 1995/03/21 15:08:42 cgd Exp $";
+#endif
#endif /* not lint */
-# include <signal.h>
-# include <curses.h>
-# include <unistd.h>
-# include "deck.h"
-# include "cribbage.h"
-# include "cribcur.h"
-# include "pathnames.h"
+#include <curses.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "deck.h"
+#include "cribbage.h"
+#include "cribcur.h"
+#include "pathnames.h"
+int
main(argc, argv)
-int argc;
-char *argv[];
+ int argc;
+ char *argv[];
{
- extern char *optarg;
- extern int optind;
- register char *p;
+ BOOLEAN playing;
+ FILE *f;
int ch;
- BOOLEAN playing;
- char *s; /* for reading arguments */
- FILE *f;
- FILE *fopen();
- char *getline();
- void rint();
while ((ch = getopt(argc, argv, "eqr")) != EOF)
- switch(ch) {
+ switch (ch) {
case 'e':
explain = TRUE;
break;
@@ -83,9 +85,10 @@ char *argv[];
}
initscr();
- signal(SIGINT, rint);
+ (void)signal(SIGINT, rint);
crmode();
noecho();
+
Playwin = subwin(stdscr, PLAY_Y, PLAY_X, 0, 0);
Tablewin = subwin(stdscr, TABLE_Y, TABLE_X, 0, PLAY_X);
Compwin = subwin(stdscr, COMP_Y, COMP_X, 0, TABLE_X + PLAY_X);
@@ -96,41 +99,41 @@ char *argv[];
clearok(stdscr, FALSE);
if (!quiet) {
- msg("Do you need instructions for cribbage? ");
- if (getuchar() == 'Y') {
- endwin();
- clear();
- mvcur(0, COLS - 1, LINES - 1, 0);
- fflush(stdout);
- instructions();
- crmode();
- noecho();
- clear();
- refresh();
- msg("For the rules of this program, do \"man cribbage\"");
- }
+ msg("Do you need instructions for cribbage? ");
+ if (getuchar() == 'Y') {
+ endwin();
+ clear();
+ mvcur(0, COLS - 1, LINES - 1, 0);
+ fflush(stdout);
+ instructions();
+ crmode();
+ noecho();
+ clear();
+ refresh();
+ msg("For cribbage rules, use \"man cribbage\"");
+ }
}
playing = TRUE;
do {
- wclrtobot(Msgwin);
- msg(quiet ? "L or S? " : "Long (to 121) or Short (to 61)? ");
- if (glimit == SGAME)
- glimit = (getuchar() == 'L' ? LGAME : SGAME);
- else
- glimit = (getuchar() == 'S' ? SGAME : LGAME);
- game();
- msg("Another game? ");
- playing = (getuchar() == 'Y');
+ wclrtobot(Msgwin);
+ msg(quiet ? "L or S? " : "Long (to 121) or Short (to 61)? ");
+ if (glimit == SGAME)
+ glimit = (getuchar() == 'L' ? LGAME : SGAME);
+ else
+ glimit = (getuchar() == 'S' ? SGAME : LGAME);
+ game();
+ msg("Another game? ");
+ playing = (getuchar() == 'Y');
} while (playing);
if (f = fopen(_PATH_LOG, "a")) {
(void)fprintf(f, "%s: won %5.5d, lost %5.5d\n",
- getlogin(), cgames, pgames);
- (void)fclose(f);
+ getlogin(), cgames, pgames);
+ (void) fclose(f);
}
bye();
if (!f) {
- (void)fprintf(stderr, "\ncribbage: can't open %s.\n",
+ (void) fprintf(stderr, "\ncribbage: can't open %s.\n",
_PATH_LOG);
exit(1);
}
@@ -141,34 +144,45 @@ char *argv[];
* makeboard:
* Print out the initial board on the screen
*/
+void
makeboard()
{
- mvaddstr(SCORE_Y + 0, SCORE_X, "+---------------------------------------+");
- mvaddstr(SCORE_Y + 1, SCORE_X, "| Score: 0 YOU |");
- mvaddstr(SCORE_Y + 2, SCORE_X, "| *.....:.....:.....:.....:.....:..... |");
- mvaddstr(SCORE_Y + 3, SCORE_X, "| *.....:.....:.....:.....:.....:..... |");
- mvaddstr(SCORE_Y + 4, SCORE_X, "| |");
- mvaddstr(SCORE_Y + 5, SCORE_X, "| *.....:.....:.....:.....:.....:..... |");
- mvaddstr(SCORE_Y + 6, SCORE_X, "| *.....:.....:.....:.....:.....:..... |");
- mvaddstr(SCORE_Y + 7, SCORE_X, "| Score: 0 ME |");
- mvaddstr(SCORE_Y + 8, SCORE_X, "+---------------------------------------+");
- gamescore();
+ mvaddstr(SCORE_Y + 0, SCORE_X,
+ "+---------------------------------------+");
+ mvaddstr(SCORE_Y + 1, SCORE_X,
+ "| Score: 0 YOU |");
+ mvaddstr(SCORE_Y + 2, SCORE_X,
+ "| *.....:.....:.....:.....:.....:..... |");
+ mvaddstr(SCORE_Y + 3, SCORE_X,
+ "| *.....:.....:.....:.....:.....:..... |");
+ mvaddstr(SCORE_Y + 4, SCORE_X,
+ "| |");
+ mvaddstr(SCORE_Y + 5, SCORE_X,
+ "| *.....:.....:.....:.....:.....:..... |");
+ mvaddstr(SCORE_Y + 6, SCORE_X,
+ "| *.....:.....:.....:.....:.....:..... |");
+ mvaddstr(SCORE_Y + 7, SCORE_X,
+ "| Score: 0 ME |");
+ mvaddstr(SCORE_Y + 8, SCORE_X,
+ "+---------------------------------------+");
+ gamescore();
}
/*
* gamescore:
* Print out the current game score
*/
+void
gamescore()
{
- extern int Lastscore[];
-
- if (pgames || cgames) {
- mvprintw(SCORE_Y + 1, SCORE_X + 28, "Games: %3d", pgames);
- mvprintw(SCORE_Y + 7, SCORE_X + 28, "Games: %3d", cgames);
- }
- Lastscore[0] = -1;
- Lastscore[1] = -1;
+ extern int Lastscore[];
+
+ if (pgames || cgames) {
+ mvprintw(SCORE_Y + 1, SCORE_X + 28, "Games: %3d", pgames);
+ mvprintw(SCORE_Y + 7, SCORE_X + 28, "Games: %3d", cgames);
+ }
+ Lastscore[0] = -1;
+ Lastscore[1] = -1;
}
/*
@@ -176,92 +190,88 @@ gamescore()
* Play one game up to glimit points. Actually, we only ASK the
* player what card to turn. We do a random one, anyway.
*/
+void
game()
{
- register int i, j;
- BOOLEAN flag;
- BOOLEAN compcrib;
- char *getline();
+ register int i, j;
+ BOOLEAN flag;
+ BOOLEAN compcrib;
- makeboard();
- refresh();
makedeck(deck);
shuffle(deck);
if (gamecount == 0) {
- flag = TRUE;
- do {
- if (!rflag) { /* player cuts deck */
- msg(quiet ? "Cut for crib? " :
- "Cut to see whose crib it is -- low card wins? ");
- getline();
- }
- i = (rand() >> 4) % CARDS; /* random cut */
- do { /* comp cuts deck */
- j = (rand() >> 4) % CARDS;
- } while (j == i);
- addmsg(quiet ? "You cut " : "You cut the ");
- msgcard(deck[i], FALSE);
- endmsg();
- addmsg(quiet ? "I cut " : "I cut the ");
- msgcard(deck[j], FALSE);
- endmsg();
- flag = (deck[i].rank == deck[j].rank);
- if (flag) {
- msg(quiet ? "We tied..." :
- "We tied and have to try again...");
- shuffle(deck);
- continue;
- }
- else
- compcrib = (deck[i].rank > deck[j].rank);
- } while (flag);
- }
- else {
- werase(Tablewin);
- wrefresh(Tablewin);
- werase(Compwin);
- wrefresh(Compwin);
- msg("Loser (%s) gets first crib", (iwon ? "you" : "me"));
- compcrib = !iwon;
+ flag = TRUE;
+ do {
+ if (!rflag) { /* player cuts deck */
+ msg(quiet ? "Cut for crib? " :
+ "Cut to see whose crib it is -- low card wins? ");
+ getline();
+ }
+ i = (rand() >> 4) % CARDS; /* random cut */
+ do { /* comp cuts deck */
+ j = (rand() >> 4) % CARDS;
+ } while (j == i);
+ addmsg(quiet ? "You cut " : "You cut the ");
+ msgcard(deck[i], FALSE);
+ endmsg();
+ addmsg(quiet ? "I cut " : "I cut the ");
+ msgcard(deck[j], FALSE);
+ endmsg();
+ flag = (deck[i].rank == deck[j].rank);
+ if (flag) {
+ msg(quiet ? "We tied..." :
+ "We tied and have to try again...");
+ shuffle(deck);
+ continue;
+ } else
+ compcrib = (deck[i].rank > deck[j].rank);
+ } while (flag);
+ clear();
+ makeboard();
+ refresh();
+ } else {
+ werase(Tablewin);
+ wrefresh(Tablewin);
+ werase(Compwin);
+ wrefresh(Compwin);
+ msg("Loser (%s) gets first crib", (iwon ? "you" : "me"));
+ compcrib = !iwon;
}
pscore = cscore = 0;
flag = TRUE;
do {
- shuffle(deck);
- flag = !playhand(compcrib);
- compcrib = !compcrib;
+ shuffle(deck);
+ flag = !playhand(compcrib);
+ compcrib = !compcrib;
} while (flag);
++gamecount;
if (cscore < pscore) {
- if (glimit - cscore > 60) {
- msg("YOU DOUBLE SKUNKED ME!");
- pgames += 4;
- }
- else if (glimit - cscore > 30) {
- msg("YOU SKUNKED ME!");
- pgames += 2;
- }
- else {
- msg("YOU WON!");
- ++pgames;
- }
- iwon = FALSE;
- }
- else {
- if (glimit - pscore > 60) {
- msg("I DOUBLE SKUNKED YOU!");
- cgames += 4;
- }
- else if (glimit - pscore > 30) {
- msg("I SKUNKED YOU!");
- cgames += 2;
- }
- else {
- msg("I WON!");
- ++cgames;
- }
- iwon = TRUE;
+ if (glimit - cscore > 60) {
+ msg("YOU DOUBLE SKUNKED ME!");
+ pgames += 4;
+ } else
+ if (glimit - cscore > 30) {
+ msg("YOU SKUNKED ME!");
+ pgames += 2;
+ } else {
+ msg("YOU WON!");
+ ++pgames;
+ }
+ iwon = FALSE;
+ } else {
+ if (glimit - pscore > 60) {
+ msg("I DOUBLE SKUNKED YOU!");
+ cgames += 4;
+ } else
+ if (glimit - pscore > 30) {
+ msg("I SKUNKED YOU!");
+ cgames += 2;
+ } else {
+ msg("I WON!");
+ ++cgames;
+ }
+ iwon = TRUE;
}
gamescore();
}
@@ -270,11 +280,11 @@ game()
* playhand:
* Do up one hand of the game
*/
+int
playhand(mycrib)
-BOOLEAN mycrib;
+ BOOLEAN mycrib;
{
- register int deckpos;
- extern char Msgbuf[];
+ register int deckpos;
werase(Compwin);
@@ -286,38 +296,35 @@ BOOLEAN mycrib;
prhand(phand, FULLHAND, Playwin, FALSE);
discard(mycrib);
if (cut(mycrib, deckpos))
- return TRUE;
+ return TRUE;
if (peg(mycrib))
- return TRUE;
+ return TRUE;
werase(Tablewin);
wrefresh(Tablewin);
if (score(mycrib))
- return TRUE;
+ return TRUE;
return FALSE;
}
-
-
/*
* deal cards to both players from deck
*/
-
-deal( mycrib )
+int
+deal(mycrib)
+ BOOLEAN mycrib;
{
- register int i, j;
-
- j = 0;
- for( i = 0; i < FULLHAND; i++ ) {
- if( mycrib ) {
- phand[i] = deck[j++];
- chand[i] = deck[j++];
- }
- else {
- chand[i] = deck[j++];
- phand[i] = deck[j++];
- }
+ register int i, j;
+
+ for (i = j = 0; i < FULLHAND; i++) {
+ if (mycrib) {
+ phand[i] = deck[j++];
+ chand[i] = deck[j++];
+ } else {
+ chand[i] = deck[j++];
+ phand[i] = deck[j++];
+ }
}
- return( j );
+ return (j);
}
/*
@@ -325,20 +332,22 @@ deal( mycrib )
* Handle players discarding into the crib...
* Note: we call cdiscard() after prining first message so player doesn't wait
*/
+void
discard(mycrib)
-BOOLEAN mycrib;
+ BOOLEAN mycrib;
{
- register char *prompt;
- CARD crd;
+ register char *prompt;
+ CARD crd;
prcrib(mycrib, TRUE);
prompt = (quiet ? "Discard --> " : "Discard a card --> ");
- cdiscard(mycrib); /* puts best discard at end */
+ cdiscard(mycrib); /* puts best discard at end */
crd = phand[infrom(phand, FULLHAND, prompt)];
cremove(crd, phand, FULLHAND);
prhand(phand, FULLHAND, Playwin, FALSE);
crib[0] = crd;
-/* next four lines same as last four except for cdiscard() */
+
+ /* Next four lines same as last four except for cdiscard(). */
crd = phand[infrom(phand, FULLHAND - 1, prompt)];
cremove(crd, phand, FULLHAND - 1);
prhand(phand, FULLHAND, Playwin, FALSE);
@@ -353,232 +362,237 @@ BOOLEAN mycrib;
* Cut the deck and set turnover. Actually, we only ASK the
* player what card to turn. We do a random one, anyway.
*/
+int
cut(mycrib, pos)
-BOOLEAN mycrib;
-int pos;
+ BOOLEAN mycrib;
+ int pos;
{
- register int i, cardx;
- BOOLEAN win = FALSE;
- char *getline();
+ register int i;
+ BOOLEAN win;
+ win = FALSE;
if (mycrib) {
- if (!rflag) { /* random cut */
- msg(quiet ? "Cut the deck? " :
- "How many cards down do you wish to cut the deck? ");
- getline();
- }
- i = (rand() >> 4) % (CARDS - pos);
- turnover = deck[i + pos];
- addmsg(quiet ? "You cut " : "You cut the ");
- msgcard(turnover, FALSE);
- endmsg();
- if (turnover.rank == JACK) {
- msg("I get two for his heels");
- win = chkscr(&cscore,2 );
- }
- }
- else {
- i = (rand() >> 4) % (CARDS - pos) + pos;
- turnover = deck[i];
- addmsg(quiet ? "I cut " : "I cut the ");
- msgcard(turnover, FALSE);
- endmsg();
- if (turnover.rank == JACK) {
- msg("You get two for his heels");
- win = chkscr(&pscore, 2);
- }
+ if (!rflag) { /* random cut */
+ msg(quiet ? "Cut the deck? " :
+ "How many cards down do you wish to cut the deck? ");
+ getline();
+ }
+ i = (rand() >> 4) % (CARDS - pos);
+ turnover = deck[i + pos];
+ addmsg(quiet ? "You cut " : "You cut the ");
+ msgcard(turnover, FALSE);
+ endmsg();
+ if (turnover.rank == JACK) {
+ msg("I get two for his heels");
+ win = chkscr(&cscore, 2);
+ }
+ } else {
+ i = (rand() >> 4) % (CARDS - pos) + pos;
+ turnover = deck[i];
+ addmsg(quiet ? "I cut " : "I cut the ");
+ msgcard(turnover, FALSE);
+ endmsg();
+ if (turnover.rank == JACK) {
+ msg("You get two for his heels");
+ win = chkscr(&pscore, 2);
+ }
}
makeknown(&turnover, 1);
prcrib(mycrib, FALSE);
- return win;
+ return (win);
}
/*
* prcrib:
* Print out the turnover card with crib indicator
*/
+void
prcrib(mycrib, blank)
-BOOLEAN mycrib, blank;
+ BOOLEAN mycrib, blank;
{
- register int y, cardx;
+ register int y, cardx;
if (mycrib)
- cardx = CRIB_X;
+ cardx = CRIB_X;
else
- cardx = 0;
+ cardx = 0;
mvaddstr(CRIB_Y, cardx + 1, "CRIB");
prcard(stdscr, CRIB_Y + 1, cardx, turnover, blank);
if (mycrib)
- cardx = 0;
+ cardx = 0;
else
- cardx = CRIB_X;
+ cardx = CRIB_X;
for (y = CRIB_Y; y <= CRIB_Y + 5; y++)
- mvaddstr(y, cardx, " ");
+ mvaddstr(y, cardx, " ");
}
/*
* peg:
* Handle all the pegging...
*/
+static CARD Table[14];
+static int Tcnt;
-static CARD Table[14];
-
-static int Tcnt;
-
+int
peg(mycrib)
-BOOLEAN mycrib;
+ BOOLEAN mycrib;
{
- static CARD ch[CINHAND], ph[CINHAND];
- CARD crd;
- register int i, j, k;
- register int l;
- register int cnum, pnum, sum;
- register BOOLEAN myturn, mego, ugo, last, played;
+ static CARD ch[CINHAND], ph[CINHAND];
+ register int i, j, k;
+ register int l;
+ register int cnum, pnum, sum;
+ register BOOLEAN myturn, mego, ugo, last, played;
+ CARD crd;
cnum = pnum = CINHAND;
- for (i = 0; i < CINHAND; i++) { /* make copies of hands */
- ch[i] = chand[i];
- ph[i] = phand[i];
+ for (i = 0; i < CINHAND; i++) { /* make copies of hands */
+ ch[i] = chand[i];
+ ph[i] = phand[i];
}
- Tcnt = 0; /* index to table of cards played */
- sum = 0; /* sum of cards played */
+ Tcnt = 0; /* index to table of cards played */
+ sum = 0; /* sum of cards played */
mego = ugo = FALSE;
myturn = !mycrib;
for (;;) {
- last = TRUE; /* enable last flag */
- prhand(ph, pnum, Playwin, FALSE);
- prhand(ch, cnum, Compwin, TRUE);
- prtable(sum);
- if (myturn) { /* my tyrn to play */
- if (!anymove(ch, cnum, sum)) { /* if no card to play */
- if (!mego && cnum) { /* go for comp? */
- msg("GO");
- mego = TRUE;
- }
- if (anymove(ph, pnum, sum)) /* can player move? */
- myturn = !myturn;
- else { /* give him his point */
- msg(quiet ? "You get one" : "You get one point");
- if (chkscr(&pscore, 1))
- return TRUE;
- sum = 0;
- mego = ugo = FALSE;
- Tcnt = 0;
- }
- }
- else {
- played = TRUE;
- j = -1;
- k = 0;
- for (i = 0; i < cnum; i++) { /* maximize score */
- l = pegscore(ch[i], Table, Tcnt, sum);
- if (l > k) {
- k = l;
- j = i;
+ last = TRUE; /* enable last flag */
+ prhand(ph, pnum, Playwin, FALSE);
+ prhand(ch, cnum, Compwin, TRUE);
+ prtable(sum);
+ if (myturn) { /* my tyrn to play */
+ if (!anymove(ch, cnum, sum)) { /* if no card to play */
+ if (!mego && cnum) { /* go for comp? */
+ msg("GO");
+ mego = TRUE;
+ }
+ /* can player move? */
+ if (anymove(ph, pnum, sum))
+ myturn = !myturn;
+ else { /* give him his point */
+ msg(quiet ? "You get one" :
+ "You get one point");
+ if (chkscr(&pscore, 1))
+ return TRUE;
+ sum = 0;
+ mego = ugo = FALSE;
+ Tcnt = 0;
+ }
+ } else {
+ played = TRUE;
+ j = -1;
+ k = 0;
+ /* maximize score */
+ for (i = 0; i < cnum; i++) {
+ l = pegscore(ch[i], Table, Tcnt, sum);
+ if (l > k) {
+ k = l;
+ j = i;
+ }
+ }
+ if (j < 0) /* if nothing scores */
+ j = cchose(ch, cnum, sum);
+ crd = ch[j];
+ cremove(crd, ch, cnum--);
+ sum += VAL(crd.rank);
+ Table[Tcnt++] = crd;
+ if (k > 0) {
+ addmsg(quiet ? "I get %d playing " :
+ "I get %d points playing ", k);
+ msgcard(crd, FALSE);
+ endmsg();
+ if (chkscr(&cscore, k))
+ return TRUE;
+ }
+ myturn = !myturn;
+ }
+ } else {
+ if (!anymove(ph, pnum, sum)) { /* can player move? */
+ if (!ugo && pnum) { /* go for player */
+ msg("You have a GO");
+ ugo = TRUE;
+ }
+ /* can computer play? */
+ if (anymove(ch, cnum, sum))
+ myturn = !myturn;
+ else {
+ msg(quiet ? "I get one" :
+ "I get one point");
+ do_wait();
+ if (chkscr(&cscore, 1))
+ return TRUE;
+ sum = 0;
+ mego = ugo = FALSE;
+ Tcnt = 0;
+ }
+ } else { /* player plays */
+ played = FALSE;
+ if (pnum == 1) {
+ crd = ph[0];
+ msg("You play your last card");
+ } else
+ for (;;) {
+ prhand(ph,
+ pnum, Playwin, FALSE);
+ crd = ph[infrom(ph,
+ pnum, "Your play: ")];
+ if (sum + VAL(crd.rank) <= 31)
+ break;
+ else
+ msg("Total > 31 -- try again");
+ }
+ makeknown(&crd, 1);
+ cremove(crd, ph, pnum--);
+ i = pegscore(crd, Table, Tcnt, sum);
+ sum += VAL(crd.rank);
+ Table[Tcnt++] = crd;
+ if (i > 0) {
+ msg(quiet ? "You got %d" :
+ "You got %d points", i);
+ if (chkscr(&pscore, i))
+ return TRUE;
+ }
+ myturn = !myturn;
}
- }
- if (j < 0) /* if nothing scores */
- j = cchose(ch, cnum, sum);
- crd = ch[j];
- cremove(crd, ch, cnum--);
- sum += VAL(crd.rank);
- Table[Tcnt++] = crd;
- if (k > 0) {
- addmsg(quiet ? "I get %d playing " :
- "I get %d points playing ", k);
- msgcard(crd, FALSE);
- endmsg();
- if (chkscr(&cscore, k))
- return TRUE;
- }
- myturn = !myturn;
}
- }
- else {
- if (!anymove(ph, pnum, sum)) { /* can player move? */
- if (!ugo && pnum) { /* go for player */
- msg("You have a GO");
- ugo = TRUE;
- }
- if (anymove(ch, cnum, sum)) /* can computer play? */
- myturn = !myturn;
- else {
- msg(quiet ? "I get one" : "I get one point");
- do_wait();
- if (chkscr(&cscore, 1))
- return TRUE;
+ if (sum >= 31) {
+ if (!myturn)
+ do_wait();
sum = 0;
mego = ugo = FALSE;
Tcnt = 0;
- }
- }
- else { /* player plays */
- played = FALSE;
- if (pnum == 1) {
- crd = ph[0];
- msg("You play your last card");
- }
- else
- for (;;) {
- prhand(ph, pnum, Playwin, FALSE);
- crd = ph[infrom(ph, pnum, "Your play: ")];
- if (sum + VAL(crd.rank) <= 31)
- break;
- else
- msg("Total > 31 -- try again");
- }
- makeknown(&crd, 1);
- cremove(crd, ph, pnum--);
- i = pegscore(crd, Table, Tcnt, sum);
- sum += VAL(crd.rank);
- Table[Tcnt++] = crd;
- if (i > 0) {
- msg(quiet ? "You got %d" : "You got %d points", i);
- if (chkscr(&pscore, i))
- return TRUE;
- }
- myturn = !myturn;
+ last = FALSE; /* disable last flag */
}
- }
- if (sum >= 31) {
- if (!myturn)
- do_wait();
- sum = 0;
- mego = ugo = FALSE;
- Tcnt = 0;
- last = FALSE; /* disable last flag */
- }
- if (!pnum && !cnum)
- break; /* both done */
+ if (!pnum && !cnum)
+ break; /* both done */
}
prhand(ph, pnum, Playwin, FALSE);
prhand(ch, cnum, Compwin, TRUE);
prtable(sum);
if (last)
- if (played) {
- msg(quiet ? "I get one for last" : "I get one point for last");
- do_wait();
- if (chkscr(&cscore, 1))
- return TRUE;
- }
- else {
- msg(quiet ? "You get one for last" :
+ if (played) {
+ msg(quiet ? "I get one for last" :
+ "I get one point for last");
+ do_wait();
+ if (chkscr(&cscore, 1))
+ return TRUE;
+ } else {
+ msg(quiet ? "You get one for last" :
"You get one point for last");
- if (chkscr(&pscore, 1))
- return TRUE;
- }
- return FALSE;
+ if (chkscr(&pscore, 1))
+ return TRUE;
+ }
+ return (FALSE);
}
/*
* prtable:
* Print out the table with the current score
*/
+void
prtable(score)
-int score;
+ int score;
{
prhand(Table, Tcnt, Tablewin, FALSE);
mvwprintw(Tablewin, (Tcnt + 2) * 2, Tcnt + 1, "%2d", score);
@@ -589,26 +603,26 @@ int score;
* score:
* Handle the scoring of the hands
*/
+int
score(mycrib)
-BOOLEAN mycrib;
+ BOOLEAN mycrib;
{
sorthand(crib, CINHAND);
if (mycrib) {
- if (plyrhand(phand, "hand"))
- return TRUE;
- if (comphand(chand, "hand"))
- return TRUE;
- do_wait();
- if (comphand(crib, "crib"))
- return TRUE;
- }
- else {
- if (comphand(chand, "hand"))
- return TRUE;
- if (plyrhand(phand, "hand"))
- return TRUE;
- if (plyrhand(crib, "crib"))
- return TRUE;
+ if (plyrhand(phand, "hand"))
+ return (TRUE);
+ if (comphand(chand, "hand"))
+ return (TRUE);
+ do_wait();
+ if (comphand(crib, "crib"))
+ return (TRUE);
+ } else {
+ if (comphand(chand, "hand"))
+ return (TRUE);
+ if (plyrhand(phand, "hand"))
+ return (TRUE);
+ if (plyrhand(crib, "crib"))
+ return (TRUE);
}
- return FALSE;
+ return (FALSE);
}
diff --git a/cribbage/cribbage.6 b/cribbage/cribbage.6
index 64694fae..f7be11c1 100644
--- a/cribbage/cribbage.6
+++ b/cribbage/cribbage.6
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1980 Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: cribbage.6,v 1.4 1995/03/21 15:08:45 cgd Exp $
+.\"
+.\" Copyright (c) 1980, 1993
+.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -29,10 +31,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)cribbage.6 6.5 (Berkeley) 6/23/90
-.\" $Id: cribbage.6,v 1.3 1993/08/05 04:02:18 jtc Exp $
+.\" @(#)cribbage.6 8.1 (Berkeley) 5/31/93
.\"
-.Dd June 23, 1990
+.Dd May 31, 1993
.Dt CRIBBAGE 6
.Os
.Sh NAME
diff --git a/cribbage/cribbage.h b/cribbage/cribbage.h
index ffd6bd7d..4ddec968 100644
--- a/cribbage/cribbage.h
+++ b/cribbage/cribbage.h
@@ -1,6 +1,8 @@
+/* $NetBSD: cribbage.h,v 1.3 1995/03/21 15:08:46 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,8 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)cribbage.h 5.4 (Berkeley) 6/1/90
- * $Id: cribbage.h,v 1.2 1993/08/01 18:55:21 mycroft Exp $
+ * @(#)cribbage.h 8.1 (Berkeley) 5/31/93
*/
extern CARD deck[ CARDS ]; /* a deck */
@@ -60,3 +61,54 @@ extern BOOLEAN playing; /* currently playing game */
extern char expl[]; /* string for explanation */
+void addmsg __P((const char *, ...));
+int adjust __P((CARD [], CARD));
+int anymove __P((CARD [], int, int));
+int anysumto __P((CARD [], int, int, int));
+void bye __P((void));
+int cchose __P((CARD [], int, int));
+void cdiscard __P((BOOLEAN));
+int chkscr __P((int *, int));
+int comphand __P((CARD [], char *));
+void cremove __P((CARD, CARD [], int));
+int cut __P((BOOLEAN, int));
+int deal __P((int));
+void discard __P((BOOLEAN));
+void do_wait __P((void));
+void endmsg __P((void));
+int eq __P((CARD, CARD));
+int fifteens __P((CARD [], int));
+void game __P((void));
+void gamescore __P((void));
+char *getline __P((void));
+int getuchar __P((void));
+int incard __P((CARD *));
+int infrom __P((CARD [], int, char *));
+void instructions __P((void));
+int isone __P((CARD, CARD [], int));
+void makeboard __P((void));
+void makedeck __P((CARD []));
+void makeknown __P((CARD [], int));
+void msg __P((const char *, ...));
+int msgcard __P((CARD, BOOLEAN));
+int msgcrd __P((CARD, BOOLEAN, char *, BOOLEAN));
+int number __P((int, int, char *));
+int numofval __P((CARD [], int, int));
+int pairuns __P((CARD [], int));
+int peg __P((BOOLEAN));
+int pegscore __P((CARD, CARD [], int, int));
+int playhand __P((BOOLEAN));
+int plyrhand __P((CARD [], char *));
+void prcard __P((WINDOW *, int, int, CARD, BOOLEAN));
+void prcrib __P((BOOLEAN, BOOLEAN));
+void prhand __P((CARD [], int, WINDOW *, BOOLEAN));
+void printcard __P((WINDOW *, int, CARD, BOOLEAN));
+void prpeg __P((int, int, BOOLEAN));
+void prtable __P((int));
+int readchar __P((void));
+void rint __P((int));
+int score __P((BOOLEAN));
+int scorehand __P((CARD [], CARD, int, BOOLEAN, BOOLEAN));
+void shuffle __P((CARD []));
+void sorthand __P((CARD [], int));
+void wait_for __P((int));
diff --git a/cribbage/cribcur.h b/cribbage/cribcur.h
index ed099f66..b209f546 100644
--- a/cribbage/cribcur.h
+++ b/cribbage/cribcur.h
@@ -1,6 +1,8 @@
+/* $NetBSD: cribcur.h,v 1.3 1995/03/21 15:08:48 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,8 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)cribcur.h 5.4 (Berkeley) 6/1/90
- * $Id: cribcur.h,v 1.2 1993/08/01 18:55:20 mycroft Exp $
+ * @(#)cribcur.h 8.1 (Berkeley) 5/31/93
*/
# define PLAY_Y 15 /* size of player's hand window */
diff --git a/cribbage/deck.h b/cribbage/deck.h
index 6d78c818..796175e0 100644
--- a/cribbage/deck.h
+++ b/cribbage/deck.h
@@ -1,6 +1,8 @@
+/* $NetBSD: deck.h,v 1.3 1995/03/21 15:08:49 cgd Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,8 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)deck.h 5.4 (Berkeley) 6/1/90
- * $Id: deck.h,v 1.2 1993/08/01 18:55:18 mycroft Exp $
+ * @(#)deck.h 8.1 (Berkeley) 5/31/93
*/
/*
diff --git a/cribbage/extern.c b/cribbage/extern.c
index f5bf0a84..1b7c4125 100644
--- a/cribbage/extern.c
+++ b/cribbage/extern.c
@@ -1,6 +1,8 @@
-/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+/* $NetBSD: extern.c,v 1.3 1995/03/21 15:08:50 cgd Exp $ */
+
+/*-
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,13 +34,17 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)extern.c 5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: extern.c,v 1.2 1993/08/01 18:55:14 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)extern.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: extern.c,v 1.3 1995/03/21 15:08:50 cgd Exp $";
+#endif
#endif /* not lint */
-# include <curses.h>
-# include "deck.h"
-# include "cribbage.h"
+#include <curses.h>
+
+#include "deck.h"
+#include "cribbage.h"
bool explain = FALSE; /* player mistakes explained */
bool iwon = FALSE; /* if comp won last game */
diff --git a/cribbage/instr.c b/cribbage/instr.c
index 181cc2f6..b4ecda0d 100644
--- a/cribbage/instr.c
+++ b/cribbage/instr.c
@@ -1,6 +1,8 @@
+/* $NetBSD: instr.c,v 1.3 1995/03/21 15:08:52 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,20 +34,29 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)instr.c 5.2 (Berkeley) 2/28/91";*/
-static char rcsid[] = "$Id: instr.c,v 1.2 1993/08/01 18:55:13 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)instr.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: instr.c,v 1.3 1995/03/21 15:08:52 cgd Exp $";
+#endif
#endif /* not lint */
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/errno.h>
#include <sys/stat.h>
-#include <unistd.h>
+
+#include <curses.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
+
+#include "deck.h"
+#include "cribbage.h"
#include "pathnames.h"
+void
instructions()
{
extern int errno;
@@ -59,7 +70,7 @@ instructions()
strerror(errno));
exit(1);
}
- switch(pid = vfork()) {
+ switch (pid = vfork()) {
case -1:
(void)fprintf(stderr, "cribbage: %s.\n", strerror(errno));
exit(1);
diff --git a/cribbage/io.c b/cribbage/io.c
index ab1c538d..bdc2d35c 100644
--- a/cribbage/io.c
+++ b/cribbage/io.c
@@ -1,6 +1,8 @@
-/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+/* $NetBSD: io.c,v 1.7 1995/03/21 15:08:53 cgd Exp $ */
+
+/*-
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,181 +34,103 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)io.c 5.8 (Berkeley) 2/28/91";*/
-static char rcsid[] = "$Id: io.c,v 1.6 1993/12/08 07:50:47 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: io.c,v 1.7 1995/03/21 15:08:53 cgd Exp $";
+#endif
#endif /* not lint */
-# include <curses.h>
-# include <termios.h>
-# include <ctype.h>
-# include <signal.h>
-# include <stdarg.h>
-# include "deck.h"
-# include "cribbage.h"
-# include "cribcur.h"
-
-# define LINESIZE 128
-
-# ifdef CTRL
-# undef CTRL
-# endif
-# define CTRL(X) ('X' - 'A' + 1)
-
-# ifdef notdef /* defined in curses.h */
-# define erasechar() _tty.sg_erase
-# define killchar() _tty.sg_kill
-# endif
-
-char linebuf[ LINESIZE ];
-
-char *rankname[ RANKS ] = { "ACE", "TWO", "THREE", "FOUR",
- "FIVE", "SIX", "SEVEN", "EIGHT",
- "NINE", "TEN", "JACK", "QUEEN",
- "KING" };
-
-char *rankchar[ RANKS ] = { "A", "2", "3", "4", "5", "6", "7",
- "8", "9", "T", "J", "Q", "K" };
-
-char *suitname[ SUITS ] = { "SPADES", "HEARTS", "DIAMONDS",
- "CLUBS" };
-
-char *suitchar[ SUITS ] = { "S", "H", "D", "C" };
-
-
-
-/*
- * msg:
- * Display a message at the top of the screen.
- */
-char Msgbuf[BUFSIZ] = { '\0' };
-
-int Mpos = 0;
+#include <ctype.h>
+#include <curses.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <string.h>
+#include <termios.h>
+#include <unistd.h>
+
+#if __STDC__
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
-static int Newpos = 0;
+#include "deck.h"
+#include "cribbage.h"
+#include "cribcur.h"
-msg(char *fmt, ...)
-{
- va_list ap;
+#define LINESIZE 128
- va_start(ap, fmt);
- (void)vsprintf(&Msgbuf[Newpos], fmt, ap);
- endmsg();
-}
+#ifdef CTRL
+#undef CTRL
+#endif
+#define CTRL(X) (X - 'A' + 1)
-/*
- * addmsg:
- * Add things to the current message
- */
-addmsg(char *fmt, ...)
-{
- va_list ap;
+char linebuf[LINESIZE];
- va_start(ap, fmt);
- (void)vsprintf(&Msgbuf[Newpos], fmt, ap);
-}
+char *rankname[RANKS] = {
+ "ACE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN",
+ "EIGHT", "NINE", "TEN", "JACK", "QUEEN", "KING"
+};
-/*
- * endmsg:
- * Display a new msg.
- */
+char *rankchar[RANKS] = {
+ "A", "2", "3", "4", "5", "6", "7", "8", "9", "T", "J", "Q", "K"
+};
-int Lineno = 0;
+char *suitname[SUITS] = {"SPADES", "HEARTS", "DIAMONDS", "CLUBS"};
-endmsg()
-{
- register int len;
- register char *mp, *omp;
- static int lastline = 0;
-
- /*
- * All messages should start with uppercase
- */
- mvaddch(lastline + Y_MSG_START, SCORE_X, ' ');
- if (islower(Msgbuf[0]) && Msgbuf[1] != ')')
- Msgbuf[0] = toupper(Msgbuf[0]);
- mp = Msgbuf;
- len = strlen(mp);
- if (len / MSG_X + Lineno >= MSG_Y) {
- while (Lineno < MSG_Y) {
- wmove(Msgwin, Lineno++, 0);
- wclrtoeol(Msgwin);
- }
- Lineno = 0;
- }
- mvaddch(Lineno + Y_MSG_START, SCORE_X, '*');
- lastline = Lineno;
- do {
- mvwaddstr(Msgwin, Lineno, 0, mp);
- if ((len = strlen(mp)) > MSG_X) {
- omp = mp;
- for (mp = &mp[MSG_X-1]; *mp != ' '; mp--)
- continue;
- while (*mp == ' ')
- mp--;
- mp++;
- wmove(Msgwin, Lineno, mp - omp);
- wclrtoeol(Msgwin);
- }
- if (++Lineno >= MSG_Y)
- Lineno = 0;
- } while (len > MSG_X);
- wclrtoeol(Msgwin);
- Mpos = len;
- Newpos = 0;
- wrefresh(Msgwin);
- refresh();
- wrefresh(Msgwin);
-}
+char *suitchar[SUITS] = {"S", "H", "D", "C"};
/*
* msgcard:
* Call msgcrd in one of two forms
*/
+int
msgcard(c, brief)
-CARD c;
-BOOLEAN brief;
+ CARD c;
+ BOOLEAN brief;
{
if (brief)
- return msgcrd(c, TRUE, (char *) NULL, TRUE);
+ return (msgcrd(c, TRUE, NULL, TRUE));
else
- return msgcrd(c, FALSE, " of ", FALSE);
+ return (msgcrd(c, FALSE, " of ", FALSE));
}
-
-
/*
* msgcrd:
* Print the value of a card in ascii
*/
+int
msgcrd(c, brfrank, mid, brfsuit)
-CARD c;
-char *mid;
-BOOLEAN brfrank, brfsuit;
+ CARD c;
+ BOOLEAN brfrank, brfsuit;
+ char *mid;
{
if (c.rank == EMPTY || c.suit == EMPTY)
- return FALSE;
+ return (FALSE);
if (brfrank)
- addmsg("%1.1s", rankchar[c.rank]);
+ addmsg("%1.1s", rankchar[c.rank]);
else
- addmsg(rankname[c.rank]);
+ addmsg(rankname[c.rank]);
if (mid != NULL)
- addmsg(mid);
+ addmsg(mid);
if (brfsuit)
- addmsg("%1.1s", suitchar[c.suit]);
+ addmsg("%1.1s", suitchar[c.suit]);
else
- addmsg(suitname[c.suit]);
- return TRUE;
+ addmsg(suitname[c.suit]);
+ return (TRUE);
}
/*
* printcard:
* Print out a card.
*/
+void
printcard(win, cardno, c, blank)
-WINDOW *win;
-int cardno;
-CARD c;
-BOOLEAN blank;
+ WINDOW *win;
+ int cardno;
+ CARD c;
+ BOOLEAN blank;
{
prcard(win, cardno * 2, cardno, c, blank);
}
@@ -215,14 +139,16 @@ BOOLEAN blank;
* prcard:
* Print out a card on the window at the specified location
*/
+void
prcard(win, y, x, c, blank)
-WINDOW *win;
-int y, x;
-CARD c;
-BOOLEAN blank;
+ WINDOW *win;
+ int y, x;
+ CARD c;
+ BOOLEAN blank;
{
if (c.rank == EMPTY)
- return;
+ return;
+
mvwaddstr(win, y + 0, x, "+-----+");
mvwaddstr(win, y + 1, x, "| |");
mvwaddstr(win, y + 2, x, "| |");
@@ -240,171 +166,177 @@ BOOLEAN blank;
* prhand:
* Print a hand of n cards
*/
+void
prhand(h, n, win, blank)
-CARD h[];
-int n;
-WINDOW *win;
-BOOLEAN blank;
+ CARD h[];
+ int n;
+ WINDOW *win;
+ BOOLEAN blank;
{
- register int i;
+ register int i;
werase(win);
for (i = 0; i < n; i++)
- printcard(win, i, *h++, blank);
+ printcard(win, i, *h++, blank);
wrefresh(win);
}
-
-
/*
* infrom:
* reads a card, supposedly in hand, accepting unambigous brief
* input, returns the index of the card found...
*/
+int
infrom(hand, n, prompt)
-CARD hand[];
-int n;
-char *prompt;
+ CARD hand[];
+ int n;
+ char *prompt;
{
- register int i, j;
- CARD crd;
+ register int i, j;
+ CARD crd;
if (n < 1) {
- printf("\nINFROM: %d = n < 1!!\n", n);
- exit(74);
+ printf("\nINFROM: %d = n < 1!!\n", n);
+ exit(74);
}
for (;;) {
- msg(prompt);
- if (incard(&crd)) { /* if card is full card */
- if (!isone(crd, hand, n))
- msg("That's not in your hand");
- else {
- for (i = 0; i < n; i++)
- if (hand[i].rank == crd.rank &&
- hand[i].suit == crd.suit)
- break;
- if (i >= n) {
+ msg(prompt);
+ if (incard(&crd)) { /* if card is full card */
+ if (!isone(crd, hand, n))
+ msg("That's not in your hand");
+ else {
+ for (i = 0; i < n; i++)
+ if (hand[i].rank == crd.rank &&
+ hand[i].suit == crd.suit)
+ break;
+ if (i >= n) {
printf("\nINFROM: isone or something messed up\n");
- exit(77);
- }
- return i;
- }
- }
- else /* if not full card... */
- if (crd.rank != EMPTY) {
- for (i = 0; i < n; i++)
- if (hand[i].rank == crd.rank)
- break;
- if (i >= n)
- msg("No such rank in your hand");
- else {
- for (j = i + 1; j < n; j++)
- if (hand[j].rank == crd.rank)
- break;
- if (j < n)
- msg("Ambiguous rank");
- else
- return i;
- }
- }
- else
- msg("Sorry, I missed that");
+ exit(77);
+ }
+ return (i);
+ }
+ } else /* if not full card... */
+ if (crd.rank != EMPTY) {
+ for (i = 0; i < n; i++)
+ if (hand[i].rank == crd.rank)
+ break;
+ if (i >= n)
+ msg("No such rank in your hand");
+ else {
+ for (j = i + 1; j < n; j++)
+ if (hand[j].rank == crd.rank)
+ break;
+ if (j < n)
+ msg("Ambiguous rank");
+ else
+ return (i);
+ }
+ } else
+ msg("Sorry, I missed that");
}
/* NOTREACHED */
}
-
-
/*
* incard:
* Inputs a card in any format. It reads a line ending with a CR
* and then parses it.
*/
+int
incard(crd)
-CARD *crd;
+ CARD *crd;
{
- char *getline();
- register int i;
- int rnk, sut;
- char *line, *p, *p1;
- BOOLEAN retval;
+ register int i;
+ int rnk, sut;
+ char *line, *p, *p1;
+ BOOLEAN retval;
retval = FALSE;
rnk = sut = EMPTY;
if (!(line = getline()))
goto gotit;
p = p1 = line;
- while( *p1 != ' ' && *p1 != NULL ) ++p1;
+ while (*p1 != ' ' && *p1 != NULL)
+ ++p1;
*p1++ = NULL;
- if( *p == NULL ) goto gotit;
- /* IMPORTANT: no real card has 2 char first name */
- if( strlen(p) == 2 ) { /* check for short form */
- rnk = EMPTY;
- for( i = 0; i < RANKS; i++ ) {
- if( *p == *rankchar[i] ) {
- rnk = i;
- break;
+ if (*p == NULL)
+ goto gotit;
+
+ /* IMPORTANT: no real card has 2 char first name */
+ if (strlen(p) == 2) { /* check for short form */
+ rnk = EMPTY;
+ for (i = 0; i < RANKS; i++) {
+ if (*p == *rankchar[i]) {
+ rnk = i;
+ break;
+ }
}
- }
- if( rnk == EMPTY ) goto gotit; /* it's nothing... */
- ++p; /* advance to next char */
- sut = EMPTY;
- for( i = 0; i < SUITS; i++ ) {
- if( *p == *suitchar[i] ) {
- sut = i;
- break;
+ if (rnk == EMPTY)
+ goto gotit; /* it's nothing... */
+ ++p; /* advance to next char */
+ sut = EMPTY;
+ for (i = 0; i < SUITS; i++) {
+ if (*p == *suitchar[i]) {
+ sut = i;
+ break;
+ }
}
- }
- if( sut != EMPTY ) retval = TRUE;
- goto gotit;
+ if (sut != EMPTY)
+ retval = TRUE;
+ goto gotit;
}
rnk = EMPTY;
- for( i = 0; i < RANKS; i++ ) {
- if( !strcmp( p, rankname[i] ) || !strcmp( p, rankchar[i] ) ) {
- rnk = i;
- break;
- }
+ for (i = 0; i < RANKS; i++) {
+ if (!strcmp(p, rankname[i]) || !strcmp(p, rankchar[i])) {
+ rnk = i;
+ break;
+ }
}
- if( rnk == EMPTY ) goto gotit;
+ if (rnk == EMPTY)
+ goto gotit;
p = p1;
- while( *p1 != ' ' && *p1 != NULL ) ++p1;
+ while (*p1 != ' ' && *p1 != NULL)
+ ++p1;
*p1++ = NULL;
- if( *p == NULL ) goto gotit;
- if( !strcmp( "OF", p ) ) {
- p = p1;
- while( *p1 != ' ' && *p1 != NULL ) ++p1;
- *p1++ = NULL;
- if( *p == NULL ) goto gotit;
+ if (*p == NULL)
+ goto gotit;
+ if (!strcmp("OF", p)) {
+ p = p1;
+ while (*p1 != ' ' && *p1 != NULL)
+ ++p1;
+ *p1++ = NULL;
+ if (*p == NULL)
+ goto gotit;
}
sut = EMPTY;
- for( i = 0; i < SUITS; i++ ) {
- if( !strcmp( p, suitname[i] ) || !strcmp( p, suitchar[i] ) ) {
- sut = i;
- break;
- }
+ for (i = 0; i < SUITS; i++) {
+ if (!strcmp(p, suitname[i]) || !strcmp(p, suitchar[i])) {
+ sut = i;
+ break;
+ }
}
- if( sut != EMPTY ) retval = TRUE;
+ if (sut != EMPTY)
+ retval = TRUE;
gotit:
(*crd).rank = rnk;
(*crd).suit = sut;
- return( retval );
+ return (retval);
}
-
-
/*
* getuchar:
* Reads and converts to upper case
*/
+int
getuchar()
{
- register int c;
+ register int c;
c = readchar();
if (islower(c))
- c = toupper(c);
+ c = toupper(c);
waddch(Msgwin, c);
- return c;
+ return (c);
}
/*
@@ -412,129 +344,213 @@ getuchar()
* Reads in a decimal number and makes sure it is between "lo" and
* "hi" inclusive.
*/
+int
number(lo, hi, prompt)
-int lo, hi;
-char *prompt;
+ int lo, hi;
+ char *prompt;
{
- char *getline();
- register char *p;
- register int sum;
-
- sum = 0;
- for (;;) {
- msg(prompt);
- if(!(p = getline()) || *p == NULL) {
- msg(quiet ? "Not a number" : "That doesn't look like a number");
- continue;
- }
- sum = 0;
-
- if (!isdigit(*p))
- sum = lo - 1;
- else
- while (isdigit(*p)) {
- sum = 10 * sum + (*p - '0');
- ++p;
+ register char *p;
+ register int sum;
+
+ for (sum = 0;;) {
+ msg(prompt);
+ if (!(p = getline()) || *p == NULL) {
+ msg(quiet ? "Not a number" :
+ "That doesn't look like a number");
+ continue;
}
+ sum = 0;
- if (*p != ' ' && *p != '\t' && *p != NULL)
- sum = lo - 1;
- if (sum >= lo && sum <= hi)
- return sum;
- if (sum == lo - 1)
- msg("that doesn't look like a number, try again --> ");
- else
+ if (!isdigit(*p))
+ sum = lo - 1;
+ else
+ while (isdigit(*p)) {
+ sum = 10 * sum + (*p - '0');
+ ++p;
+ }
+
+ if (*p != ' ' && *p != '\t' && *p != NULL)
+ sum = lo - 1;
+ if (sum >= lo && sum <= hi)
+ break;
+ if (sum == lo - 1)
+ msg("that doesn't look like a number, try again --> ");
+ else
msg("%d is not between %d and %d inclusive, try again --> ",
- sum, lo, hi);
+ sum, lo, hi);
}
+ return (sum);
}
-#ifdef notdef
/*
- * doadd:
- * Perform an add onto the message buffer
+ * msg:
+ * Display a message at the top of the screen.
*/
-doadd(fmt, args)
-char *fmt;
-int *args;
+char Msgbuf[BUFSIZ] = {'\0'};
+int Mpos = 0;
+static int Newpos = 0;
+
+void
+#if __STDC__
+msg(const char *fmt, ...)
+#else
+msg(fmt, va_alist)
+ char *fmt;
+ va_dcl
+#endif
{
- static FILE junk;
-
- /*
- * Do the printf into Msgbuf
- */
- junk._flag = _IOWRT + _IOSTRG;
- junk._ptr = &Msgbuf[Newpos];
- junk._cnt = 32767;
- _doprnt(fmt, args, &junk);
- putc('\0', &junk);
- Newpos = strlen(Msgbuf);
+ va_list ap;
+
+#if __STDC__
+ va_start(ap, fmt);
+#else
+ va_start(ap);
+#endif
+ (void)vsprintf(&Msgbuf[Newpos], fmt, ap);
+ va_end(ap);
+ endmsg();
}
+
+/*
+ * addmsg:
+ * Add things to the current message
+ */
+void
+#if __STDC__
+addmsg(const char *fmt, ...)
+#else
+addmsg(fmt, va_alist)
+ char *fmt;
+ va_dcl
#endif
+{
+ va_list ap;
+
+#if __STDC__
+ va_start(ap, fmt);
+#else
+ va_start(ap);
+#endif
+ (void)vsprintf(&Msgbuf[Newpos], fmt, ap);
+ va_end(ap);
+}
+
+/*
+ * endmsg:
+ * Display a new msg.
+ */
+int Lineno = 0;
+
+void
+endmsg()
+{
+ static int lastline = 0;
+ register int len;
+ register char *mp, *omp;
+
+ /* All messages should start with uppercase */
+ mvaddch(lastline + Y_MSG_START, SCORE_X, ' ');
+ if (islower(Msgbuf[0]) && Msgbuf[1] != ')')
+ Msgbuf[0] = toupper(Msgbuf[0]);
+ mp = Msgbuf;
+ len = strlen(mp);
+ if (len / MSG_X + Lineno >= MSG_Y) {
+ while (Lineno < MSG_Y) {
+ wmove(Msgwin, Lineno++, 0);
+ wclrtoeol(Msgwin);
+ }
+ Lineno = 0;
+ }
+ mvaddch(Lineno + Y_MSG_START, SCORE_X, '*');
+ lastline = Lineno;
+ do {
+ mvwaddstr(Msgwin, Lineno, 0, mp);
+ if ((len = strlen(mp)) > MSG_X) {
+ omp = mp;
+ for (mp = &mp[MSG_X - 1]; *mp != ' '; mp--)
+ continue;
+ while (*mp == ' ')
+ mp--;
+ mp++;
+ wmove(Msgwin, Lineno, mp - omp);
+ wclrtoeol(Msgwin);
+ }
+ if (++Lineno >= MSG_Y)
+ Lineno = 0;
+ } while (len > MSG_X);
+ wclrtoeol(Msgwin);
+ Mpos = len;
+ Newpos = 0;
+ wrefresh(Msgwin);
+ refresh();
+ wrefresh(Msgwin);
+}
/*
* do_wait:
* Wait for the user to type ' ' before doing anything else
*/
+void
do_wait()
{
- register int line;
- static char prompt[] = { '-', '-', 'M', 'o', 'r', 'e', '-', '-', '\0' };
+ static char prompt[] = {'-', '-', 'M', 'o', 'r', 'e', '-', '-', '\0'};
- if (Mpos + sizeof prompt < MSG_X)
- wmove(Msgwin, Lineno > 0 ? Lineno - 1 : MSG_Y - 1, Mpos);
- else {
- mvwaddch(Msgwin, Lineno, 0, ' ');
- wclrtoeol(Msgwin);
- if (++Lineno >= MSG_Y)
- Lineno = 0;
- }
- waddstr(Msgwin, prompt);
- wrefresh(Msgwin);
- wait_for(' ');
+ if (Mpos + sizeof prompt < MSG_X)
+ wmove(Msgwin, Lineno > 0 ? Lineno - 1 : MSG_Y - 1, Mpos);
+ else {
+ mvwaddch(Msgwin, Lineno, 0, ' ');
+ wclrtoeol(Msgwin);
+ if (++Lineno >= MSG_Y)
+ Lineno = 0;
+ }
+ waddstr(Msgwin, prompt);
+ wrefresh(Msgwin);
+ wait_for(' ');
}
/*
* wait_for
* Sit around until the guy types the right key
*/
+void
wait_for(ch)
-register char ch;
+ register int ch;
{
- register char c;
-
- if (ch == '\n')
- while ((c = readchar()) != '\n')
- continue;
- else
- while (readchar() != ch)
- continue;
+ register char c;
+
+ if (ch == '\n')
+ while ((c = readchar()) != '\n')
+ continue;
+ else
+ while (readchar() != ch)
+ continue;
}
/*
* readchar:
* Reads and returns a character, checking for gross input errors
*/
+int
readchar()
{
- register int cnt, y, x;
- auto char c;
+ register int cnt;
+ char c;
over:
- cnt = 0;
- while (read(0, &c, 1) <= 0)
- if (cnt++ > 100) { /* if we are getting infinite EOFs */
- bye(); /* quit the game */
- exit(1);
+ cnt = 0;
+ while (read(STDIN_FILENO, &c, sizeof(char)) <= 0)
+ if (cnt++ > 100) { /* if we are getting infinite EOFs */
+ bye(); /* quit the game */
+ exit(1);
+ }
+ if (c == CTRL('L')) {
+ wrefresh(curscr);
+ goto over;
}
- if (c == CTRL(L)) {
- wrefresh(curscr);
- goto over;
- }
- if (c == '\r')
- return '\n';
- else
- return c;
+ if (c == '\r')
+ return ('\n');
+ else
+ return (c);
}
/*
@@ -545,53 +561,55 @@ over:
char *
getline()
{
- register char *sp;
- register int c, oy, ox;
- register WINDOW *oscr;
-
- oscr = stdscr;
- stdscr = Msgwin;
- getyx(stdscr, oy, ox);
- refresh();
- /*
- * loop reading in the string, and put it in a temporary buffer
- */
- for (sp = linebuf; (c = readchar()) != '\n'; clrtoeol(), refresh()) {
- if (c == -1)
- continue;
- else if (c == erasechar()) { /* process erase character */
- if (sp > linebuf) {
- register int i;
-
- sp--;
- for (i = strlen(unctrl(*sp)); i; i--)
- addch('\b');
- }
- continue;
- }
- else if (c == killchar()) { /* process kill character */
- sp = linebuf;
- move(oy, ox);
- continue;
- }
- else if (sp == linebuf && c == ' ')
- continue;
- if (sp >= &linebuf[LINESIZE-1] || !(isprint(c) || c == ' '))
- putchar(CTRL(G));
- else {
- if (islower(c))
- c = toupper(c);
- *sp++ = c;
- addstr(unctrl(c));
- Mpos++;
+ register char *sp;
+ register int c, oy, ox;
+ register WINDOW *oscr;
+
+ oscr = stdscr;
+ stdscr = Msgwin;
+ getyx(stdscr, oy, ox);
+ refresh();
+ /* loop reading in the string, and put it in a temporary buffer */
+ for (sp = linebuf; (c = readchar()) != '\n'; clrtoeol(), refresh()) {
+ if (c == -1)
+ continue;
+ else
+ if (c == erasechar()) { /* process erase character */
+ if (sp > linebuf) {
+ register int i;
+
+ sp--;
+ for (i = strlen(unctrl(*sp)); i; i--)
+ addch('\b');
+ }
+ continue;
+ } else
+ if (c == killchar()) { /* process kill
+ * character */
+ sp = linebuf;
+ move(oy, ox);
+ continue;
+ } else
+ if (sp == linebuf && c == ' ')
+ continue;
+ if (sp >= &linebuf[LINESIZE - 1] || !(isprint(c) || c == ' '))
+ putchar(CTRL('G'));
+ else {
+ if (islower(c))
+ c = toupper(c);
+ *sp++ = c;
+ addstr(unctrl(c));
+ Mpos++;
+ }
}
- }
- *sp = '\0';
- stdscr = oscr;
- return linebuf;
+ *sp = '\0';
+ stdscr = oscr;
+ return (linebuf);
}
-rint()
+void
+rint(signo)
+ int signo;
{
bye();
exit(1);
@@ -601,6 +619,7 @@ rint()
* bye:
* Leave the program, cleaning things up as we go.
*/
+void
bye()
{
signal(SIGINT, SIG_IGN);
diff --git a/cribbage/pathnames.h b/cribbage/pathnames.h
index 6c26900b..70f9f183 100644
--- a/cribbage/pathnames.h
+++ b/cribbage/pathnames.h
@@ -1,6 +1,8 @@
+/* $NetBSD: pathnames.h,v 1.3 1995/03/21 15:08:56 cgd Exp $ */
+
/*-
- * Copyright (c) 1990 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1990, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,10 +32,9 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)pathnames.h 5.1 (Berkeley) 5/1/90
- * $Id: pathnames.h,v 1.2 1993/08/01 18:55:17 mycroft Exp $
+ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93
*/
+#define _PATH_INSTR "/usr/share/games/cribbage.instr"
#define _PATH_LOG "/var/games/criblog"
#define _PATH_MORE "/usr/bin/more"
-#define _PATH_INSTR "/usr/share/games/cribbage.instr"
diff --git a/cribbage/score.c b/cribbage/score.c
index d3fddd9a..93f8c075 100644
--- a/cribbage/score.c
+++ b/cribbage/score.c
@@ -1,6 +1,8 @@
-/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+/* $NetBSD: score.c,v 1.3 1995/03/21 15:08:57 cgd Exp $ */
+
+/*-
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,14 +34,20 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)score.c 5.5 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: score.c,v 1.2 1993/08/01 18:55:11 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: score.c,v 1.3 1995/03/21 15:08:57 cgd Exp $";
+#endif
#endif /* not lint */
-#include <stdio.h>
-#include "deck.h"
-#include "cribbage.h"
+#include <curses.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "deck.h"
+#include "cribbage.h"
/*
* the following arrays give the sum of the scores of the (50 2)*48 = 58800
@@ -47,8 +55,7 @@ static char rcsid[] = "$Id: score.c,v 1.2 1993/08/01 18:55:11 mycroft Exp $";
* array. the two arrays are for the case where the suits are equal and
* not equal respectively
*/
-
-long crbescr[ 169 ] = {
+long crbescr[169] = {
-10000, 271827, 278883, 332319, 347769, 261129, 250653, 253203, 248259,
243435, 256275, 237435, 231051, -10000, -10000, 412815, 295707, 349497,
267519, 262521, 259695, 254019, 250047, 262887, 244047, 237663, -10000,
@@ -67,9 +74,10 @@ long crbescr[ 169 ] = {
-10000, -10000, -10000, -10000, -10000, -10000, 304287, 262971, -10000,
-10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000,
-10000, -10000, 244131, -10000, -10000, -10000, -10000, -10000, -10000,
- -10000, -10000, -10000, -10000, -10000, -10000, -10000 };
+ -10000, -10000, -10000, -10000, -10000, -10000, -10000
+};
-long crbnescr[ 169 ] = {
+long crbnescr[169] = {
325272, 260772, 267828, 321264, 336714, 250074, 239598, 242148, 237204,
232380, 246348, 226380, 219996, -10000, 342528, 401760, 284652, 338442,
256464, 251466, 248640, 242964, 238992, 252960, 232992, 226608, -10000,
@@ -88,147 +96,142 @@ long crbnescr[ 169 ] = {
-10000, -10000, -10000, -10000, -10000, 348600, 294360, 253044, -10000,
-10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000, -10000,
-10000, 308664, 233076, -10000, -10000, -10000, -10000, -10000, -10000,
- -10000, -10000, -10000, -10000, -10000, -10000, 295896 };
-
-
-static int ichoose2[ 5 ] = { 0, 0, 2, 6, 12 };
-static int pairpoints, runpoints; /* globals from pairuns */
+ -10000, -10000, -10000, -10000, -10000, -10000, 295896
+};
+static int ichoose2[5] = { 0, 0, 2, 6, 12 };
+static int pairpoints, runpoints; /* Globals from pairuns. */
/*
* scorehand:
* Score the given hand of n cards and the starter card.
* n must be <= 4
*/
+int
scorehand(hand, starter, n, crb, do_explain)
-register CARD hand[];
-CARD starter;
-int n;
-BOOLEAN crb; /* true if scoring crib */
-BOOLEAN do_explain; /* true if must explain this hand */
+ register CARD hand[];
+ CARD starter;
+ int n;
+ BOOLEAN crb; /* true if scoring crib */
+ BOOLEAN do_explain; /* true if must explain this hand */
{
- CARD h[(CINHAND + 1)];
- register int i, k;
- register int score;
- register BOOLEAN flag;
- char buf[32];
+ register int i, k;
+ register int score;
+ register BOOLEAN flag;
+ CARD h[(CINHAND + 1)];
+ char buf[32];
expl[0] = NULL; /* initialize explanation */
score = 0;
flag = TRUE;
k = hand[0].suit;
- for (i = 0; i < n; i++) { /* check for flush */
- flag = (flag && (hand[i].suit == k));
- if (hand[i].rank == JACK) /* check for his nibs */
- if (hand[i].suit == starter.suit) {
- score++;
- if (do_explain)
- strcat(expl, "His Nobs");
- }
- h[i] = hand[i];
+ for (i = 0; i < n; i++) { /* check for flush */
+ flag = (flag && (hand[i].suit == k));
+ if (hand[i].rank == JACK) /* check for his nibs */
+ if (hand[i].suit == starter.suit) {
+ score++;
+ if (do_explain)
+ strcat(expl, "His Nobs");
+ }
+ h[i] = hand[i];
}
if (flag && n >= CINHAND) {
- if (do_explain && expl[0] != NULL)
- strcat(expl, ", ");
- if (starter.suit == k) {
- score += 5;
- if (do_explain)
- strcat(expl, "Five-flush");
- }
- else if (!crb) {
- score += 4;
if (do_explain && expl[0] != NULL)
- strcat(expl, ", Four-flush");
- else
- strcpy(expl, "Four-flush");
- }
+ strcat(expl, ", ");
+ if (starter.suit == k) {
+ score += 5;
+ if (do_explain)
+ strcat(expl, "Five-flush");
+ } else
+ if (!crb) {
+ score += 4;
+ if (do_explain && expl[0] != NULL)
+ strcat(expl, ", Four-flush");
+ else
+ strcpy(expl, "Four-flush");
+ }
}
-
if (do_explain && expl[0] != NULL)
- strcat(expl, ", ");
+ strcat(expl, ", ");
h[n] = starter;
- sorthand(h, n + 1); /* sort by rank */
+ sorthand(h, n + 1); /* sort by rank */
i = 2 * fifteens(h, n + 1);
score += i;
if (do_explain)
- if (i > 0) {
- (void)sprintf(buf, "%d points in fifteens", i);
- strcat(expl, buf);
- }
- else
- strcat(expl, "No fifteens");
+ if (i > 0) {
+ (void) sprintf(buf, "%d points in fifteens", i);
+ strcat(expl, buf);
+ } else
+ strcat(expl, "No fifteens");
i = pairuns(h, n + 1);
score += i;
if (do_explain)
- if (i > 0) {
- (void)sprintf(buf, ", %d points in pairs, %d in runs",
- pairpoints, runpoints);
- strcat(expl, buf);
- }
- else
- strcat(expl, ", No pairs/runs");
- return score;
+ if (i > 0) {
+ (void) sprintf(buf, ", %d points in pairs, %d in runs",
+ pairpoints, runpoints);
+ strcat(expl, buf);
+ } else
+ strcat(expl, ", No pairs/runs");
+ return (score);
}
/*
* fifteens:
* Return number of fifteens in hand of n cards
*/
+int
fifteens(hand, n)
-register CARD hand[];
-int n;
+ register CARD hand[];
+ int n;
{
- register int *sp, *np;
- register int i;
- register CARD *endp;
- static int sums[15], nsums[15];
+ register int *sp, *np;
+ register int i;
+ register CARD *endp;
+ static int sums[15], nsums[15];
np = nsums;
sp = sums;
i = 16;
while (--i) {
- *np++ = 0;
- *sp++ = 0;
+ *np++ = 0;
+ *sp++ = 0;
}
for (endp = &hand[n]; hand < endp; hand++) {
- i = hand->rank + 1;
- if (i > 10)
- i = 10;
- np = &nsums[i];
- np[-1]++; /* one way to make this */
- sp = sums;
- while (i < 15) {
- *np++ += *sp++;
- i++;
- }
- sp = sums;
- np = nsums;
- i = 16;
- while (--i)
- *sp++ = *np++;
+ i = hand->rank + 1;
+ if (i > 10)
+ i = 10;
+ np = &nsums[i];
+ np[-1]++; /* one way to make this */
+ sp = sums;
+ while (i < 15) {
+ *np++ += *sp++;
+ i++;
+ }
+ sp = sums;
+ np = nsums;
+ i = 16;
+ while (--i)
+ *sp++ = *np++;
}
return sums[14];
}
-
-
/*
* pairuns returns the number of points in the n card sorted hand
* due to pairs and runs
* this routine only works if n is strictly less than 6
* sets the globals pairpoints and runpoints appropriately
*/
-
-pairuns( h, n )
-
- CARD h[];
- int n;
+int
+pairuns(h, n)
+ CARD h[];
+ int n;
{
- register int i;
- int runlength, runmult, lastmult, curmult;
- int mult1, mult2, pair1, pair2;
- BOOLEAN run;
+ register int i;
+ int runlength, runmult, lastmult, curmult;
+ int mult1, mult2, pair1, pair2;
+ BOOLEAN run;
run = TRUE;
runlength = 1;
@@ -237,129 +240,134 @@ pairuns( h, n )
mult2 = 1;
pair2 = -1;
curmult = runmult = 1;
- for( i = 1; i < n; i++ ) {
- lastmult = curmult;
- if( h[i].rank == h[i - 1].rank ) {
- if( pair1 < 0 ) {
- pair1 = h[i].rank;
- mult1 = curmult = 2;
- }
- else {
- if( h[i].rank == pair1 ) {
- curmult = ++mult1;
- }
- else {
- if( pair2 < 0 ) {
- pair2 = h[i].rank;
- mult2 = curmult = 2;
+ for (i = 1; i < n; i++) {
+ lastmult = curmult;
+ if (h[i].rank == h[i - 1].rank) {
+ if (pair1 < 0) {
+ pair1 = h[i].rank;
+ mult1 = curmult = 2;
+ } else {
+ if (h[i].rank == pair1) {
+ curmult = ++mult1;
+ } else {
+ if (pair2 < 0) {
+ pair2 = h[i].rank;
+ mult2 = curmult = 2;
+ } else {
+ curmult = ++mult2;
+ }
+ }
}
- else {
- curmult = ++mult2;
+ if (i == (n - 1) && run) {
+ runmult *= curmult;
}
- }
- }
- if( i == (n - 1) && run ) {
- runmult *= curmult;
- }
- }
- else {
- curmult = 1;
- if( h[i].rank == h[i - 1].rank + 1 ) {
- if( run ) {
- ++runlength;
- }
- else {
- if( runlength < 3 ) { /* only if old short */
- run = TRUE;
- runlength = 2;
- runmult = 1;
+ } else {
+ curmult = 1;
+ if (h[i].rank == h[i - 1].rank + 1) {
+ if (run) {
+ ++runlength;
+ } else {
+ /* only if old short */
+ if (runlength < 3) {
+ run = TRUE;
+ runlength = 2;
+ runmult = 1;
+ }
+ }
+ runmult *= lastmult;
+ } else {
+ /* if just ended */
+ if (run)
+ runmult *= lastmult;
+ run = FALSE;
}
- }
- runmult *= lastmult;
- }
- else {
- if( run ) runmult *= lastmult; /* if just ended */
- run = FALSE;
}
- }
}
- pairpoints = ichoose2[ mult1 ] + ichoose2[ mult2 ];
- runpoints = ( runlength >= 3 ? runlength*runmult : 0 );
- return( pairpoints + runpoints );
+ pairpoints = ichoose2[mult1] + ichoose2[mult2];
+ runpoints = (runlength >= 3 ? runlength * runmult : 0);
+ return (pairpoints + runpoints);
}
-
-
/*
* pegscore tells how many points crd would get if played after
* the n cards in tbl during pegging
*/
-
-pegscore( crd, tbl, n, sum )
-
- CARD crd, tbl[];
- int n;
- int sum;
+int
+pegscore(crd, tbl, n, sum)
+ CARD crd, tbl[];
+ int n, sum;
{
- BOOLEAN got[ RANKS ];
- register int i, j, scr;
- int k, lo, hi;
-
- sum += VAL( crd.rank );
- if( sum > 31 ) return( -1 );
- if( sum == 31 || sum == 15 ) scr = 2;
- else scr = 0;
- if( !n ) return( scr );
+ BOOLEAN got[RANKS];
+ register int i, j, scr;
+ int k, lo, hi;
+
+ sum += VAL(crd.rank);
+ if (sum > 31)
+ return (-1);
+ if (sum == 31 || sum == 15)
+ scr = 2;
+ else
+ scr = 0;
+ if (!n)
+ return (scr);
j = 1;
- while( ( crd.rank == tbl[n - j].rank ) && ( n - j >= 0 ) ) ++j;
- if( j > 1 ) return( scr + ichoose2[j] );
- if( n < 2 ) return( scr );
+ while ((crd.rank == tbl[n - j].rank) && (n - j >= 0))
+ ++j;
+ if (j > 1)
+ return (scr + ichoose2[j]);
+ if (n < 2)
+ return (scr);
lo = hi = crd.rank;
- for( i = 0; i < RANKS; i++ ) got[i] = FALSE;
- got[ crd.rank ] = TRUE;
+ for (i = 0; i < RANKS; i++)
+ got[i] = FALSE;
+ got[crd.rank] = TRUE;
k = -1;
- for( i = n - 1; i >= 0; --i ) {
- if( got[ tbl[i].rank ] ) break;
- got[ tbl[i].rank ] = TRUE;
- if( tbl[i].rank < lo ) lo = tbl[i].rank;
- if( tbl[i].rank > hi ) hi = tbl[i].rank;
- for( j = lo; j <= hi; j++ ) if( !got[j] ) break;
- if( j > hi ) k = hi - lo + 1;
+ for (i = n - 1; i >= 0; --i) {
+ if (got[tbl[i].rank])
+ break;
+ got[tbl[i].rank] = TRUE;
+ if (tbl[i].rank < lo)
+ lo = tbl[i].rank;
+ if (tbl[i].rank > hi)
+ hi = tbl[i].rank;
+ for (j = lo; j <= hi; j++)
+ if (!got[j])
+ break;
+ if (j > hi)
+ k = hi - lo + 1;
}
- if( k >= 3 ) return( scr + k );
- else return( scr );
+ if (k >= 3)
+ return (scr + k);
+ else
+ return (scr);
}
-
-
/*
* adjust takes a two card hand that will be put in the crib
* and returns an adjusted normalized score for the number of
* points such a crib will get.
*/
-
-adjust( cb, tnv )
-
- CARD cb[], tnv;
+int
+adjust(cb, tnv)
+ CARD cb[], tnv;
{
- int i, c0, c1;
- long scr;
+ long scr;
+ int i, c0, c1;
c0 = cb[0].rank;
c1 = cb[1].rank;
- if( c0 > c1 ) {
- i = c0;
- c0 = c1;
- c1 = i;
+ if (c0 > c1) {
+ i = c0;
+ c0 = c1;
+ c1 = i;
}
- if( cb[0].suit != cb[1].suit ) scr = crbnescr[ RANKS*c0 + c1 ];
- else scr = crbescr[ RANKS*c0 + c1 ];
- if( scr <= 0 ) {
- printf( "\nADJUST: internal error %d %d\n", c0, c1 );
- exit( 93 );
+ if (cb[0].suit != cb[1].suit)
+ scr = crbnescr[RANKS * c0 + c1];
+ else
+ scr = crbescr[RANKS * c0 + c1];
+ if (scr <= 0) {
+ printf("\nADJUST: internal error %d %d\n", c0, c1);
+ exit(93);
}
- return( (scr + 29400)/58800 );
+ return ((scr + 29400) / 58800);
}
-
-
-
diff --git a/cribbage/support.c b/cribbage/support.c
index 86ac6a52..a2064a21 100644
--- a/cribbage/support.c
+++ b/cribbage/support.c
@@ -1,6 +1,8 @@
-/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+/* $NetBSD: support.c,v 1.3 1995/03/21 15:08:59 cgd Exp $ */
+
+/*-
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,134 +34,145 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)support.c 5.6 (Berkeley) 2/28/91";*/
-static char rcsid[] = "$Id: support.c,v 1.2 1993/08/01 18:55:09 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)support.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: support.c,v 1.3 1995/03/21 15:08:59 cgd Exp $";
+#endif
#endif /* not lint */
-#include <curses.h>
-#include "deck.h"
-#include "cribbage.h"
-#include "cribcur.h"
+#include <curses.h>
+#include <string.h>
+#include "deck.h"
+#include "cribbage.h"
+#include "cribcur.h"
-#define NTV 10 /* number scores to test */
+#define NTV 10 /* number scores to test */
/* score to test reachability of, and order to test them in */
-int tv[ NTV ] = { 8, 7, 9, 6, 11, 12, 13, 14, 10, 5 };
-
+int tv[NTV] = {8, 7, 9, 6, 11, 12, 13, 14, 10, 5};
/*
* computer chooses what to play in pegging...
* only called if no playable card will score points
*/
-
-cchose( h, n, s )
-
- CARD h[];
- int n;
- int s;
+int
+cchose(h, n, s)
+ CARD h[];
+ int n, s;
{
- register int i, j, l;
-
- if( n <= 1 ) return( 0 );
- if( s < 4 ) { /* try for good value */
- if( ( j = anysumto(h, n, s, 4) ) >= 0 ) return( j );
- if( ( j = anysumto(h, n, s, 3) ) >= 0 && s == 0 )
- return( j );
+ register int i, j, l;
+
+ if (n <= 1)
+ return (0);
+ if (s < 4) { /* try for good value */
+ if ((j = anysumto(h, n, s, 4)) >= 0)
+ return (j);
+ if ((j = anysumto(h, n, s, 3)) >= 0 && s == 0)
+ return (j);
}
- if( s > 0 && s < 20 ) {
- for( i = 1; i <= 10; i++ ) { /* try for retaliation to 31 */
- if( ( j = anysumto(h, n, s, 21-i) ) >= 0 ) {
- if( ( l = numofval(h, n, i) ) > 0 ) {
- if( l > 1 || VAL( h[j].rank ) != i ) return( j );
- }
+ if (s > 0 && s < 20) {
+ /* try for retaliation to 31 */
+ for (i = 1; i <= 10; i++) {
+ if ((j = anysumto(h, n, s, 21 - i)) >= 0) {
+ if ((l = numofval(h, n, i)) > 0) {
+ if (l > 1 || VAL(h[j].rank) != i)
+ return (j);
+ }
+ }
}
- }
}
- if( s < 15 ) {
- for( i = 0; i < NTV; i++ ) { /* for retaliation after 15 */
- if( ( j = anysumto(h, n, s, tv[i]) ) >= 0 ) {
- if( ( l = numofval(h, n, 15-tv[i]) ) > 0 ) {
- if( l > 1 || VAL( h[j].rank ) != 15-tv[i] ) return( j );
- }
+ if (s < 15) {
+ /* for retaliation after 15 */
+ for (i = 0; i < NTV; i++) {
+ if ((j = anysumto(h, n, s, tv[i])) >= 0) {
+ if ((l = numofval(h, n, 15 - tv[i])) > 0) {
+ if (l > 1 ||
+ VAL(h[j].rank) != 15 - tv[i])
+ return (j);
+ }
+ }
}
- }
}
j = -1;
- for( i = n - 1; i >= 0; --i ) { /* remember: h is sorted */
- l = s + VAL( h[i].rank );
- if( l > 31 ) continue;
- if( l != 5 && l != 10 && l != 21 ) {
- j = i;
- break;
- }
+ /* remember: h is sorted */
+ for (i = n - 1; i >= 0; --i) {
+ l = s + VAL(h[i].rank);
+ if (l > 31)
+ continue;
+ if (l != 5 && l != 10 && l != 21) {
+ j = i;
+ break;
+ }
}
- if( j >= 0 ) return( j );
- for( i = n - 1; i >= 0; --i ) {
- l = s + VAL( h[i].rank );
- if( l > 31 ) continue;
- if( j < 0 ) j = i;
- if( l != 5 && l != 21 ) {
- j = i;
- break;
- }
+ if (j >= 0)
+ return (j);
+ for (i = n - 1; i >= 0; --i) {
+ l = s + VAL(h[i].rank);
+ if (l > 31)
+ continue;
+ if (j < 0)
+ j = i;
+ if (l != 5 && l != 21) {
+ j = i;
+ break;
+ }
}
- return( j );
+ return (j);
}
-
-
/*
* plyrhand:
* Evaluate and score a player hand or crib
*/
+int
plyrhand(hand, s)
-CARD hand[];
-char *s;
+ CARD hand[];
+ char *s;
{
- register int i, j;
- register BOOLEAN win;
- static char prompt[BUFSIZ];
-
- prhand(hand, CINHAND, Playwin, FALSE);
- (void)sprintf(prompt, "Your %s scores ", s);
- i = scorehand(hand, turnover, CINHAND, strcmp(s, "crib") == 0, explain);
- if ((j = number(0, 29, prompt)) == 19)
- j = 0;
- if (i != j) {
- if (i < j) {
- win = chkscr(&pscore, i);
- msg("It's really only %d points; I get %d", i, 2);
- if (!win)
- win = chkscr(&cscore, 2);
- }
- else {
- win = chkscr(&pscore, j);
- msg("You should have taken %d, not %d!", i, j);
- }
- if (explain)
- msg("Explanation: %s", expl);
- do_wait();
- }
- else
- win = chkscr(&pscore, i);
- return win;
+ static char prompt[BUFSIZ];
+ register int i, j;
+ register BOOLEAN win;
+
+ prhand(hand, CINHAND, Playwin, FALSE);
+ (void) sprintf(prompt, "Your %s scores ", s);
+ i = scorehand(hand, turnover, CINHAND, strcmp(s, "crib") == 0, explain);
+ if ((j = number(0, 29, prompt)) == 19)
+ j = 0;
+ if (i != j) {
+ if (i < j) {
+ win = chkscr(&pscore, i);
+ msg("It's really only %d points; I get %d", i, 2);
+ if (!win)
+ win = chkscr(&cscore, 2);
+ } else {
+ win = chkscr(&pscore, j);
+ msg("You should have taken %d, not %d!", i, j);
+ }
+ if (explain)
+ msg("Explanation: %s", expl);
+ do_wait();
+ } else
+ win = chkscr(&pscore, i);
+ return (win);
}
/*
* comphand:
* Handle scoring and displaying the computers hand
*/
+int
comphand(h, s)
-CARD h[];
-char *s;
+ CARD h[];
+ char *s;
{
- register int j;
+ register int j;
j = scorehand(h, turnover, CINHAND, strcmp(s, "crib") == 0, FALSE);
prhand(h, CINHAND, Compwin, FALSE);
msg("My %s scores %d", s, (j == 0 ? 19 : j));
- return chkscr(&cscore, j);
+ return (chkscr(&cscore, j));
}
/*
@@ -167,13 +180,13 @@ char *s;
* Add inc to scr and test for > glimit, printing on the scoring
* board while we're at it.
*/
+int Lastscore[2] = {-1, -1};
-int Lastscore[2] = {-1, -1};
-
+int
chkscr(scr, inc)
-int *scr, inc;
+ int *scr, inc;
{
- BOOLEAN myturn;
+ BOOLEAN myturn;
myturn = (scr == &cscore);
if (inc != 0) {
@@ -191,12 +204,13 @@ int *scr, inc;
* Put out the peg character on the score board and put the
* score up on the board.
*/
+void
prpeg(score, peg, myturn)
-register int score;
-char peg;
-BOOLEAN myturn;
+ register int score;
+ int peg;
+ BOOLEAN myturn;
{
- register int y, x;
+ register int y, x;
if (!myturn)
y = SCORE_Y + 2;
@@ -212,8 +226,7 @@ BOOLEAN myturn;
x = SCORE_X + 2;
y++;
}
- }
- else {
+ } else {
x = (score - 1) % 30;
if (score > 90 || (score > 30 && score <= 60)) {
y++;
@@ -230,129 +243,122 @@ BOOLEAN myturn;
* cdiscard -- the computer figures out what is the best discard for
* the crib and puts the best two cards at the end
*/
-
-cdiscard( mycrib )
-
- BOOLEAN mycrib;
+void
+cdiscard(mycrib)
+ BOOLEAN mycrib;
{
- CARD d[ CARDS ], h[ FULLHAND ], cb[ 2 ];
- register int i, j, k;
- int nc, ns;
- long sums[ 15 ];
- static int undo1[15] = {0,0,0,0,0,1,1,1,1,2,2,2,3,3,4};
- static int undo2[15] = {1,2,3,4,5,2,3,4,5,3,4,5,4,5,5};
-
- makedeck( d );
+ CARD d[CARDS], h[FULLHAND], cb[2];
+ register int i, j, k;
+ int nc, ns;
+ long sums[15];
+ static int undo1[15] = {0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 3, 3, 4};
+ static int undo2[15] = {1, 2, 3, 4, 5, 2, 3, 4, 5, 3, 4, 5, 4, 5, 5};
+
+ makedeck(d);
nc = CARDS;
- for( i = 0; i < knownum; i++ ) { /* get all other cards */
- cremove( known[i], d, nc-- );
+ for (i = 0; i < knownum; i++) { /* get all other cards */
+ cremove(known[i], d, nc--);
}
- for( i = 0; i < 15; i++ ) sums[i] = 0L;
+ for (i = 0; i < 15; i++)
+ sums[i] = 0L;
ns = 0;
- for( i = 0; i < (FULLHAND - 1); i++ ) {
- cb[0] = chand[i];
- for( j = i + 1; j < FULLHAND; j++ ) {
- cb[1] = chand[j];
- for( k = 0; k < FULLHAND; k++ ) h[k] = chand[k];
- cremove( chand[i], h, FULLHAND );
- cremove( chand[j], h, FULLHAND - 1 );
- for( k = 0; k < nc; k++ ) {
- sums[ns] += scorehand( h, d[k], CINHAND, TRUE, FALSE );
- if( mycrib ) sums[ns] += adjust( cb, d[k] );
- else sums[ns] -= adjust( cb, d[k] );
+ for (i = 0; i < (FULLHAND - 1); i++) {
+ cb[0] = chand[i];
+ for (j = i + 1; j < FULLHAND; j++) {
+ cb[1] = chand[j];
+ for (k = 0; k < FULLHAND; k++)
+ h[k] = chand[k];
+ cremove(chand[i], h, FULLHAND);
+ cremove(chand[j], h, FULLHAND - 1);
+ for (k = 0; k < nc; k++) {
+ sums[ns] +=
+ scorehand(h, d[k], CINHAND, TRUE, FALSE);
+ if (mycrib)
+ sums[ns] += adjust(cb, d[k]);
+ else
+ sums[ns] -= adjust(cb, d[k]);
+ }
+ ++ns;
}
- ++ns;
- }
}
j = 0;
- for( i = 1; i < 15; i++ ) if( sums[i] > sums[j] ) j = i;
- for( k = 0; k < FULLHAND; k++ ) h[k] = chand[k];
- cremove( h[ undo1[j] ], chand, FULLHAND );
- cremove( h[ undo2[j] ], chand, FULLHAND - 1 );
- chand[4] = h[ undo1[j] ];
- chand[5] = h[ undo2[j] ];
+ for (i = 1; i < 15; i++)
+ if (sums[i] > sums[j])
+ j = i;
+ for (k = 0; k < FULLHAND; k++)
+ h[k] = chand[k];
+ cremove(h[undo1[j]], chand, FULLHAND);
+ cremove(h[undo2[j]], chand, FULLHAND - 1);
+ chand[4] = h[undo1[j]];
+ chand[5] = h[undo2[j]];
}
-
-
/*
* returns true if some card in hand can be played without exceeding 31
*/
-
-anymove( hand, n, sum )
-
- CARD hand[];
- int n;
- int sum;
+int
+anymove(hand, n, sum)
+ CARD hand[];
+ int n, sum;
{
- register int i, j;
+ register int i, j;
- if( n < 1 ) return( FALSE );
+ if (n < 1)
+ return (FALSE);
j = hand[0].rank;
- for( i = 1; i < n; i++ ) {
- if( hand[i].rank < j ) j = hand[i].rank;
+ for (i = 1; i < n; i++) {
+ if (hand[i].rank < j)
+ j = hand[i].rank;
}
- return( sum + VAL( j ) <= 31 );
+ return (sum + VAL(j) <= 31);
}
-
-
/*
* anysumto returns the index (0 <= i < n) of the card in hand that brings
* the s up to t, or -1 if there is none
*/
-
-anysumto( hand, n, s, t )
-
- CARD hand[];
- int n;
- int s, t;
+int
+anysumto(hand, n, s, t)
+ CARD hand[];
+ int n, s, t;
{
- register int i;
+ register int i;
- for( i = 0; i < n; i++ ) {
- if( s + VAL( hand[i].rank ) == t ) return( i );
+ for (i = 0; i < n; i++) {
+ if (s + VAL(hand[i].rank) == t)
+ return (i);
}
- return( -1 );
+ return (-1);
}
-
-
-
/*
* return the number of cards in h having the given rank value
*/
-
-numofval( h, n, v )
-
- CARD h[];
- int n;
- int v;
+int
+numofval(h, n, v)
+ CARD h[];
+ int n, v;
{
- register int i, j;
+ register int i, j;
j = 0;
- for( i = 0; i < n; i++ ) {
- if( VAL( h[i].rank ) == v ) ++j;
+ for (i = 0; i < n; i++) {
+ if (VAL(h[i].rank) == v)
+ ++j;
}
- return( j );
+ return (j);
}
-
-
/*
* makeknown remembers all n cards in h for future recall
*/
-
-makeknown( h, n )
-
- CARD h[];
- int n;
+void
+makeknown(h, n)
+ CARD h[];
+ int n;
{
- register int i;
+ register int i;
- for( i = 0; i < n; i++ ) {
- known[ knownum++ ] = h[i];
- }
+ for (i = 0; i < n; i++)
+ known[knownum++] = h[i];
}
-
diff --git a/dm/Makefile b/dm/Makefile
index 721baf87..ba5ec823 100644
--- a/dm/Makefile
+++ b/dm/Makefile
@@ -1,9 +1,10 @@
-# from: @(#)Makefile 5.7 (Berkeley) 9/30/90
-# $Id: Makefile,v 1.6 1994/12/22 09:33:58 cgd Exp $
+# $NetBSD: Makefile,v 1.7 1995/03/21 15:09:02 cgd Exp $
+# @(#)Makefile 8.1 (Berkeley) 5/31/93
# -DLOG log games
PROG= dm
MAN= dm.8 dm.conf.5
+# shouldn't be necessary; just in case.
BINOWN= games
BINMODE=4555
diff --git a/dm/dm.8 b/dm/dm.8
index d0ebb5af..69ac9621 100644
--- a/dm/dm.8
+++ b/dm/dm.8
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1987, 1991 Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: dm.8,v 1.3 1995/03/21 15:09:04 cgd Exp $
+.\"
+.\" Copyright (c) 1987, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -29,10 +31,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)dm.8 5.11 (Berkeley) 7/23/91
-.\" $Id: dm.8,v 1.2 1993/08/01 07:47:10 mycroft Exp $
+.\" @(#)dm.8 8.1 (Berkeley) 5/31/93
.\"
-.Dd July 23, 1991
+.Dd May 31, 1993
.Dt DM 8
.Os
.Sh NAME
diff --git a/dm/dm.c b/dm/dm.c
index 11dedb0d..7dd82ef9 100644
--- a/dm/dm.c
+++ b/dm/dm.c
@@ -1,6 +1,8 @@
+/* $NetBSD: dm.c,v 1.4 1995/03/21 15:09:05 cgd Exp $ */
+
/*
- * Copyright (c) 1987 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1987, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -32,26 +34,33 @@
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1987 Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1987, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)dm.c 5.16 (Berkeley) 2/28/91";*/
-static char rcsid[] = "$Id: dm.c,v 1.3 1993/08/01 18:55:03 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)dm.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: dm.c,v 1.4 1995/03/21 15:09:05 cgd Exp $";
+#endif
#endif /* not lint */
#include <sys/param.h>
#include <sys/file.h>
#include <sys/time.h>
#include <sys/resource.h>
-#include <pwd.h>
-#include <utmp.h>
+
+#include <ctype.h>
#include <nlist.h>
+#include <pwd.h>
#include <stdio.h>
-#include <ctype.h>
#include <string.h>
+#include <time.h>
+#include <unistd.h>
+#include <utmp.h>
+
#include "pathnames.h"
extern int errno;
@@ -60,13 +69,12 @@ static int priority = 0; /* priority game runs at */
static char *game, /* requested game */
*gametty; /* from tty? */
-/*ARGSUSED*/
+int
main(argc, argv)
int argc;
- char **argv;
+ char *argv[];
{
- char *cp, *rindex(), *ttyname();
- time_t time();
+ char *cp;
nogamefile();
game = (cp = rindex(*argv, '/')) ? ++cp : *argv;
@@ -178,7 +186,6 @@ c_tty(tty)
{
static int first = 1;
static char *p_tty;
- char *rindex();
if (first) {
p_tty = rindex(gametty, '/');
@@ -300,11 +307,10 @@ hour(h)
*/
logfile()
{
- struct passwd *pw, *getpwuid();
+ struct passwd *pw;
FILE *lp;
uid_t uid;
int lock_cnt;
- char *ctime();
if (lp = fopen(_PATH_LOG, "a")) {
for (lock_cnt = 0;; ++lock_cnt) {
diff --git a/dm/dm.conf.5 b/dm/dm.conf.5
index 561d0c8d..53a7a4df 100644
--- a/dm/dm.conf.5
+++ b/dm/dm.conf.5
@@ -1,5 +1,7 @@
-.\" Copyright (c) 1988, 1991 Regents of the University of California.
-.\" All rights reserved.
+.\" $NetBSD: dm.conf.5,v 1.3 1995/03/21 15:09:07 cgd Exp $
+.\"
+.\" Copyright (c) 1988, 1991, 1993
+.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -29,10 +31,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)dm.conf.5 5.8 (Berkeley) 5/10/91
-.\" $Id: dm.conf.5,v 1.2 1993/08/01 07:47:09 mycroft Exp $
+.\" @(#)dm.conf.5 8.1 (Berkeley) 5/31/93
.\"
-.Dd May 10, 1991
+.Dd May 31, 1993
.Dt DM.CONF 5
.Os BSD 4.2
.Sh NAME
diff --git a/dm/pathnames.h b/dm/pathnames.h
index bf016f51..0b667aa8 100644
--- a/dm/pathnames.h
+++ b/dm/pathnames.h
@@ -1,6 +1,8 @@
+/* $NetBSD: pathnames.h,v 1.3 1995/03/21 15:09:08 cgd Exp $ */
+
/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,8 +32,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * from: @(#)pathnames.h 5.3 (Berkeley) 6/26/90
- * $Id: pathnames.h,v 1.2 1993/08/01 18:55:02 mycroft Exp $
+ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93
*/
#define _PATH_CONFIG "/etc/dm.conf"