CVS commit: src/games/dab

2015-02-11 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Thu Feb 12 06:24:21 UTC 2015

Modified Files:
src/games/dab: dab.6

Log Message:
typo


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/games/dab/dab.6

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/dab/dab.6
diff -u src/games/dab/dab.6:1.6 src/games/dab/dab.6:1.7
--- src/games/dab/dab.6:1.6	Sat Oct  6 19:39:51 2012
+++ src/games/dab/dab.6	Thu Feb 12 06:24:21 2015
@@ -1,4 +1,4 @@
-.\	$NetBSD: dab.6,v 1.6 2012/10/06 19:39:51 christos Exp $
+.\	$NetBSD: dab.6,v 1.7 2015/02/12 06:24:21 dholland Exp $
 .\
 .\ Copyright (c) 2003 Thomas Klausner.
 .\
@@ -70,7 +70,7 @@ redraw the screen, and
 .Ic q
 quits the game.
 .Pp
-Support options are:
+Supported options are:
 .Bl -tag -width XXnXngamesX
 .It Fl a
 Don't use the alternate character set.



CVS commit: src/games/dab

2012-10-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Oct  6 19:39:51 UTC 2012

Modified Files:
src/games/dab: dab.6 main.cc ttyscrn.cc ttyscrn.h

Log Message:
if 0 is used for the dimensions, compute the maximum size.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/games/dab/dab.6 src/games/dab/main.cc
cvs rdiff -u -r1.4 -r1.5 src/games/dab/ttyscrn.cc
cvs rdiff -u -r1.3 -r1.4 src/games/dab/ttyscrn.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/dab/dab.6
diff -u src/games/dab/dab.6:1.5 src/games/dab/dab.6:1.6
--- src/games/dab/dab.6:1.5	Fri Jan 15 14:39:10 2010
+++ src/games/dab/dab.6	Sat Oct  6 15:39:51 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: dab.6,v 1.5 2010/01/15 19:39:10 joerg Exp $
+.\	$NetBSD: dab.6,v 1.6 2012/10/06 19:39:51 christos Exp $
 .\
 .\ Copyright (c) 2003 Thomas Klausner.
 .\
@@ -22,7 +22,7 @@
 .\ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd December 24, 2003
+.Dd October 7, 2012
 .Dt DAB 6
 .Os
 .Sh NAME
@@ -95,6 +95,10 @@ and
 .Ar ydim
 define the size of the board in the x and y
 dimensions.
+If the dimensions specified are
+.Dv 0
+then the maximum dimensions for the size of the screen are
+used.
 .Sh SEE ALSO
 .Rs
 .%A Elwyn R. Berlekamp
Index: src/games/dab/main.cc
diff -u src/games/dab/main.cc:1.5 src/games/dab/main.cc:1.6
--- src/games/dab/main.cc:1.5	Mon Apr 28 16:22:54 2008
+++ src/games/dab/main.cc	Sat Oct  6 15:39:51 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.cc,v 1.5 2008/04/28 20:22:54 martin Exp $	*/
+/*	$NetBSD: main.cc,v 1.6 2012/10/06 19:39:51 christos Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
  * main.C: Main dots program
  */
 #include defs.h
-RCSID($NetBSD: main.cc,v 1.5 2008/04/28 20:22:54 martin Exp $)
+RCSID($NetBSD: main.cc,v 1.6 2012/10/06 19:39:51 christos Exp $)
 
 #include stdio.h
 #include unistd.h
@@ -168,7 +168,7 @@ int main(int argc, char** argv)
 	}
 }
 
-sc = TTYSCRN::create(acs, ny, nx);
+sc = TTYSCRN::create(acs, ny, nx);
 if (sc == NULL)
 	::errx(1, Dimensions too large for current screen.);
 

Index: src/games/dab/ttyscrn.cc
diff -u src/games/dab/ttyscrn.cc:1.4 src/games/dab/ttyscrn.cc:1.5
--- src/games/dab/ttyscrn.cc:1.4	Mon Apr 28 16:22:54 2008
+++ src/games/dab/ttyscrn.cc	Sat Oct  6 15:39:51 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ttyscrn.cc,v 1.4 2008/04/28 20:22:54 martin Exp $	*/
+/*	$NetBSD: ttyscrn.cc,v 1.5 2012/10/06 19:39:51 christos Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include defs.h
-RCSID($NetBSD: ttyscrn.cc,v 1.4 2008/04/28 20:22:54 martin Exp $)
+RCSID($NetBSD: ttyscrn.cc,v 1.5 2012/10/06 19:39:51 christos Exp $)
 
 #include stdio.h
 #include curses.h
@@ -191,7 +191,7 @@ void TTYSCRN::ties(const PLAYER p)
 mvwprintw(stdscr, _sy + TTYSCRN::offsties, _sx, G =:%5zd, p.getTies());
 }
 
-TTYSCRN* TTYSCRN::create(int acs, size_t y, size_t x)
+TTYSCRN* TTYSCRN::create(int acs, size_t *y, size_t *x)
 {
 int tx, ty;
 
@@ -201,11 +201,15 @@ TTYSCRN* TTYSCRN::create(int acs, size_t
 ty = getmaxy(stdscr);
 
 if (tx == ERR || ty == ERR
-	|| static_castsize_t(tx)  x * 2 + TTYSCRN::offsx + 12
-	|| static_castsize_t(ty)  y * 2 + TTYSCRN::offsy) {
+	|| static_castsize_t(tx)  *x * 2 + TTYSCRN::offsx + 14
+	|| static_castsize_t(ty)  *y * 2 + TTYSCRN::offsy) {
 	endwin();
 	return NULL;
 }
+if (*x == 0)
+	*x = (tx - 14 - TTYSCRN::offsx) / 2;
+if (*y == 0)
+	*y = (ty - TTYSCRN::offsy) / 2;
 cbreak();
 noecho();
 

Index: src/games/dab/ttyscrn.h
diff -u src/games/dab/ttyscrn.h:1.3 src/games/dab/ttyscrn.h:1.4
--- src/games/dab/ttyscrn.h:1.3	Mon Apr 28 16:22:54 2008
+++ src/games/dab/ttyscrn.h	Sat Oct  6 15:39:51 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ttyscrn.h,v 1.3 2008/04/28 20:22:54 martin Exp $	*/
+/*	$NetBSD: ttyscrn.h,v 1.4 2012/10/06 19:39:51 christos Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
 class TTYSCRN : public GAMESCREEN {
   public:
 // Constructor that can fail
-static TTYSCRN*  create(int acs, size_t y, size_t x);
+static TTYSCRN*  create(int acs, size_t *y, size_t *x);
 ~TTYSCRN();
 
 // Screen virtuals



CVS commit: src/games/dab

2012-06-15 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Jun 15 10:51:26 UTC 2012

Modified Files:
src/games/dab: algor.h

Log Message:
Remove unused fields


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/games/dab/algor.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/dab/algor.h
diff -u src/games/dab/algor.h:1.4 src/games/dab/algor.h:1.5
--- src/games/dab/algor.h:1.4	Mon Apr 28 20:22:53 2008
+++ src/games/dab/algor.h	Fri Jun 15 10:51:25 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: algor.h,v 1.4 2008/04/28 20:22:53 martin Exp $	*/
+/*	$NetBSD: algor.h,v 1.5 2012/06/15 10:51:25 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -71,10 +71,6 @@ class ALGOR : public PLAYER {
 #ifdef notyet
 size_t find_single(void);
 #endif
-
-size_t _edge1;
-size_t _edge2;
-size_t _maxedge;
 };
 
 #endif



CVS commit: src/games/dab

2012-02-29 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Feb 29 23:39:53 UTC 2012

Modified Files:
src/games/dab: algor.cc board.h

Log Message:
Fix various format string mismatches.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/games/dab/algor.cc
cvs rdiff -u -r1.3 -r1.4 src/games/dab/board.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/dab/algor.cc
diff -u src/games/dab/algor.cc:1.4 src/games/dab/algor.cc:1.5
--- src/games/dab/algor.cc:1.4	Mon Apr 28 20:22:53 2008
+++ src/games/dab/algor.cc	Wed Feb 29 23:39:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: algor.cc,v 1.4 2008/04/28 20:22:53 martin Exp $	*/
+/*	$NetBSD: algor.cc,v 1.5 2012/02/29 23:39:53 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
  * algor.C: Computer algorithm
  */
 #include defs.h
-RCSID($NetBSD: algor.cc,v 1.4 2008/04/28 20:22:53 martin Exp $)
+RCSID($NetBSD: algor.cc,v 1.5 2012/02/29 23:39:53 joerg Exp $)
 
 #include algor.h
 #include board.h
@@ -65,7 +65,7 @@ int ALGOR::find_closure(size_t y, size_
 		for (dir = BOX::first; dir  BOX::last; dir++)
 		if (!box.isset(dir))
 			return 1;
-		b.abort(find_closure: 3 sided box[%d,%d] has no free sides,
+		b.abort(find_closure: 3 sided box[%zu,%zu] has no free sides,
 			y, x);
 	}
 	}
@@ -112,7 +112,7 @@ size_t ALGOR::count_closure(size_t y, s
 	dir = tdir;
 	}
 	if ((mv = b.domove(ty, tx, tdir, getWho())) == -1)
-	b.abort(count_closure: Invalid move (%d, %d, %d), y, x, dir);
+	b.abort(count_closure: Invalid move (%zu, %zu, %d), y, x, dir);
 	else
 	i += mv;
 }
@@ -157,7 +157,7 @@ int ALGOR::try_good_turn(BOX box, size_
 {
 // Sanity check; we must have a good box
 if (box.count() = 2)
-	b.abort(try_good_turn: box[%d,%d] has more than 2 sides occupied,
+	b.abort(try_good_turn: box[%zu,%zu] has more than 2 sides occupied,
 		y, x);
 
 // Make sure we don't make a closure in an adjacent box.
@@ -203,7 +203,7 @@ int ALGOR::try_bad_turn(BOX box, size_t
 			int last)
 {
 if (4 - box.count() = last)
-	b.abort(try_bad_turn: Called at [%d,%d] for %d with %d,
+	b.abort(try_bad_turn: Called at [%zu,%zu] for %d with %d,
 		y, x, last, box.count());
 for (dir = BOX::first; dir  BOX::last; dir++)
 	if (!box.isset(dir)) {
@@ -246,7 +246,7 @@ size_t ALGOR::find_min_closure1(size_t 
 
 // Play a bad move that would cause the opponent's closure
 	if ((mv = nb.domove(ty, tx, tdir, getWho())) != 0)
-	b.abort(find_min_closure1: Invalid move %d (%d, %d, %d), mv,
+	b.abort(find_min_closure1: Invalid move %d (%zu, %zu, %d), mv,
 		ty, tx, tdir);
 
 // Count the opponent's closure

Index: src/games/dab/board.h
diff -u src/games/dab/board.h:1.3 src/games/dab/board.h:1.4
--- src/games/dab/board.h:1.3	Mon Aug 29 20:30:37 2011
+++ src/games/dab/board.h	Wed Feb 29 23:39:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: board.h,v 1.3 2011/08/29 20:30:37 joerg Exp $	*/
+/*	$NetBSD: board.h,v 1.4 2012/02/29 23:39:53 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -72,7 +72,8 @@ class BOARD {
 void games(size_t i, const PLAYER p);		// Post games
 void total(size_t i, const PLAYER p);		// Post totals
 void ties(const PLAYER p);// Post ties
-__dead void abort(const char *s, ...) const;	// Algorithm error
+__printflike(2, 3) __dead
+void abort(const char *s, ...) const;		// Algorithm error
 
 
   private:



CVS commit: src/games/dab

2011-05-23 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Mon May 23 23:06:41 UTC 2011

Modified Files:
src/games/dab: defs.h

Log Message:
Map RCSID to __RCSID


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/games/dab/defs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/dab/defs.h
diff -u src/games/dab/defs.h:1.2 src/games/dab/defs.h:1.3
--- src/games/dab/defs.h:1.2	Mon Apr 28 20:22:53 2008
+++ src/games/dab/defs.h	Mon May 23 23:06:41 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: defs.h,v 1.2 2008/04/28 20:22:53 martin Exp $	*/
+/*	$NetBSD: defs.h,v 1.3 2011/05/23 23:06:41 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -36,9 +36,8 @@
 #ifndef _H_DEFS
 #define _H_DEFS
 
-#include stdlib.h
+#include sys/cdefs.h
 
-#define RCSID(id) \
-static const char *rcsid(const char* x) { return x ? rcsid(id) : x; }
+#define RCSID(id) __RCSID(id);
 
 #endif



CVS commit: src/games/dab

2010-12-08 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Wed Dec  8 17:08:07 UTC 2010

Modified Files:
src/games/dab: gamescreen.h

Log Message:
Don't use the same name for two parameters.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/games/dab/gamescreen.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/dab/gamescreen.h
diff -u src/games/dab/gamescreen.h:1.2 src/games/dab/gamescreen.h:1.3
--- src/games/dab/gamescreen.h:1.2	Mon Apr 28 20:22:54 2008
+++ src/games/dab/gamescreen.h	Wed Dec  8 17:08:07 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: gamescreen.h,v 1.2 2008/04/28 20:22:54 martin Exp $	*/
+/*	$NetBSD: gamescreen.h,v 1.3 2010/12/08 17:08:07 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -63,9 +63,9 @@
 virtual void redraw(void) = 0;			// Refresh
 virtual int getinput(void) = 0;			// Get user input
 virtual void bell(void) = 0;			// Beep
-virtual void score(size_t p, const PLAYER p) = 0;	// Post current score
-virtual void games(size_t p, const PLAYER p) = 0;	// Post games won
-virtual void total(size_t p, const PLAYER p) = 0;	// Post total score
+virtual void score(size_t l, const PLAYER p) = 0;	// Post current score
+virtual void games(size_t l, const PLAYER p) = 0;	// Post games won
+virtual void total(size_t l, const PLAYER p) = 0;	// Post total score
 virtual void ties(const PLAYER p) = 0;		// Post tie games
 };
 



CVS commit: src/games/dab

2010-01-15 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Jan 15 19:39:10 UTC 2010

Modified Files:
src/games/dab: dab.6

Log Message:
Use .%U instead of .%O for URLs.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/games/dab/dab.6

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/dab/dab.6
diff -u src/games/dab/dab.6:1.4 src/games/dab/dab.6:1.5
--- src/games/dab/dab.6:1.4	Thu May  8 15:31:07 2008
+++ src/games/dab/dab.6	Fri Jan 15 19:39:10 2010
@@ -1,4 +1,4 @@
-.\	$NetBSD: dab.6,v 1.4 2008/05/08 15:31:07 wiz Exp $
+.\	$NetBSD: dab.6,v 1.5 2010/01/15 19:39:10 joerg Exp $
 .\
 .\ Copyright (c) 2003 Thomas Klausner.
 .\
@@ -101,7 +101,7 @@
 .%T The Dots and Boxes Game: Sophisticated Child's Play
 .%D 2000
 .%I A K Peters
-.%O http://www.akpeters.com/book.asp?bID=111
+.%U http://www.akpeters.com/book.asp?bID=111
 .Re
 .Sh AUTHORS
 .An Christos Zoulas