Module Name: src
Committed By: rillig
Date: Sat May 21 17:19:11 UTC 2022
Modified Files:
src/games/gomoku: bdisp.c gomoku.h main.c stoc.c
Log Message:
gomoku: right-align column header for move number
To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/games/gomoku/bdisp.c
cvs rdiff -u -r1.37 -r1.38 src/games/gomoku/gomoku.h
cvs rdiff -u -r1.47 -r1.48 src/games/gomoku/main.c
cvs rdiff -u -r1.18 -r1.19 src/games/gomoku/stoc.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/games/gomoku/bdisp.c
diff -u src/games/gomoku/bdisp.c:1.41 src/games/gomoku/bdisp.c:1.42
--- src/games/gomoku/bdisp.c:1.41 Sat May 21 15:21:40 2022
+++ src/games/gomoku/bdisp.c Sat May 21 17:19:10 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: bdisp.c,v 1.41 2022/05/21 15:21:40 rillig Exp $ */
+/* $NetBSD: bdisp.c,v 1.42 2022/05/21 17:19:10 rillig Exp $ */
/*
* Copyright (c) 1994
@@ -34,7 +34,7 @@
#include <sys/cdefs.h>
/* @(#)bdisp.c 8.2 (Berkeley) 5/3/95 */
-__RCSID("$NetBSD: bdisp.c,v 1.41 2022/05/21 15:21:40 rillig Exp $");
+__RCSID("$NetBSD: bdisp.c,v 1.42 2022/05/21 17:19:10 rillig Exp $");
#include <curses.h>
#include <string.h>
@@ -46,7 +46,7 @@ __RCSID("$NetBSD: bdisp.c,v 1.41 2022/05
#define SCRNW 80 /* assume 80 chars for the moment */
static int lastline;
-static char pcolor[] = "*O.?";
+static const char pcolor[] = "*O.?";
#define scr_y(by) (1 + (BSZ - 1) - ((by) - 1))
#define scr_x(bx) (3 + 2 * ((bx) - 1))
@@ -107,12 +107,12 @@ bdisp_init(void)
/* left and right edges */
for (int j = BSZ + 1; --j > 0; ) {
- mvprintw(scr_y(j), 0, "%2d ", j);
- mvprintw(scr_y(j), scr_x(BSZ) + 2, "%d ", j);
+ mvprintw(scr_y(j), 0, "%2d", j);
+ mvprintw(scr_y(j), scr_x(BSZ) + 2, "%d", j);
}
bdwho();
- mvaddstr(0, TRANSCRIPT_COL + 1, "# black white");
+ mvaddstr(0, TRANSCRIPT_COL, " # black white");
lastline = 0;
bdisp();
}
Index: src/games/gomoku/gomoku.h
diff -u src/games/gomoku/gomoku.h:1.37 src/games/gomoku/gomoku.h:1.38
--- src/games/gomoku/gomoku.h:1.37 Sat May 21 16:39:14 2022
+++ src/games/gomoku/gomoku.h Sat May 21 17:19:10 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: gomoku.h,v 1.37 2022/05/21 16:39:14 rillig Exp $ */
+/* $NetBSD: gomoku.h,v 1.38 2022/05/21 17:19:10 rillig Exp $ */
/*
* Copyright (c) 1994
@@ -215,7 +215,7 @@ struct spotstr {
#define BFLAG 0x010000 /* frame intersects border or dead */
#define BFLAGALL 0x0F0000 /* all frames dead */
-extern const char *letters;
+extern const char letters[];
extern const char pdir[];
extern const int dd[4];
Index: src/games/gomoku/main.c
diff -u src/games/gomoku/main.c:1.47 src/games/gomoku/main.c:1.48
--- src/games/gomoku/main.c:1.47 Sat May 21 14:55:26 2022
+++ src/games/gomoku/main.c Sat May 21 17:19:10 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.47 2022/05/21 14:55:26 rillig Exp $ */
+/* $NetBSD: main.c,v 1.48 2022/05/21 17:19:10 rillig Exp $ */
/*
* Copyright (c) 1994
@@ -36,7 +36,7 @@
__COPYRIGHT("@(#) Copyright (c) 1994\
The Regents of the University of California. All rights reserved.");
/* @(#)main.c 8.4 (Berkeley) 5/4/95 */
-__RCSID("$NetBSD: main.c,v 1.47 2022/05/21 14:55:26 rillig Exp $");
+__RCSID("$NetBSD: main.c,v 1.48 2022/05/21 17:19:10 rillig Exp $");
#include <sys/stat.h>
#include <curses.h>
@@ -306,9 +306,8 @@ again:
break;
}
if (interactive) {
- misclog("%3d%s%-6s", movenum,
- color != BLACK ? " " : " ",
- stoc(curmove));
+ misclog("%3d%*s%-6s", movenum,
+ color == BLACK ? 2 : 9, "", stoc(curmove));
}
if ((i = makemove(color, curmove)) != MOVEOK)
break;
Index: src/games/gomoku/stoc.c
diff -u src/games/gomoku/stoc.c:1.18 src/games/gomoku/stoc.c:1.19
--- src/games/gomoku/stoc.c:1.18 Thu May 19 22:19:18 2022
+++ src/games/gomoku/stoc.c Sat May 21 17:19:10 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: stoc.c,v 1.18 2022/05/19 22:19:18 rillig Exp $ */
+/* $NetBSD: stoc.c,v 1.19 2022/05/21 17:19:10 rillig Exp $ */
/*
* Copyright (c) 1994
@@ -34,14 +34,14 @@
#include <sys/cdefs.h>
/* @(#)stoc.c 8.1 (Berkeley) 7/24/94 */
-__RCSID("$NetBSD: stoc.c,v 1.18 2022/05/19 22:19:18 rillig Exp $");
+__RCSID("$NetBSD: stoc.c,v 1.19 2022/05/21 17:19:10 rillig Exp $");
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include "gomoku.h"
-const char *letters = "<ABCDEFGHJKLMNOPQRST>";
+const char letters[] = "<ABCDEFGHJKLMNOPQRST>";
struct mvstr {
int m_code;